- This topic has 5 replies, 3 voices, and was last updated 18 years, 4 months ago by jhuangwebelite.
-
AuthorPosts
-
JonathanOddyMemberI am running MyEclipse version: 3.8.1+QF20040825.
I’m using OJB within a project at the moment. It uses a number of XML files and “includes” one XML file within another. Specifically within repository.xml:
…
<!ENTITY user SYSTEM “repository_user.xml”>
…
<descriptor-repository version=”1.0″ isolation-level=”read-uncommitted”
proxy-prefetching-limit=”50″><!– include all used database connections –>
&database;<!– include ojb internal mappings here –>
&internal;<!– include user defined mappings here –>
&user;
…The file repository_user.xml is a xml snippet in that it is included within repository.xml. When I run validation against repository.xml I get “The XML file is valid”, yet my repository_user.xml has a red cross against it and “The markup in the documnet following the root element must be well-formed” within the file (at some arbitrary point in the file) and in the Problems tab.
This is really annoying as my project now has a little (and erroneous) red cross against it (and if I edit/validate any of the other include XML files I get more red crosses).
Any thoughts/ideas about how to get around this issue?
Jonathan
Riyad KallaMemberJonathan,
Validation is really intended for entire files, there currently isn’t a way to filter individual files so we would suggest turning off XML validation for your project, and just running it manually on the files you need it to run on. I know for JSPs in the similar situation the spec specifies to name the fragments .jspf, I don’t know if there is the same idea in xml, .xmlf maybe? THe idea being that you name non-complete files something else so the validator ignores them.
JonathanOddyMemberThanks Riyad,
I’ve turned off validation for now and that gets rid of the red cross. Manual validation will be okay at the moment because we’ve not got many XML files and those we have don’t change too often.
As a side issue, after turning off XML validation I added an error into the included file and manually ran the validator on the parent. It correctly noted that there was an error, but failed to locate it properly. It seemed to place the error line in the parent at some arbitrary location and not in the include file. This isn’t a problem when seeding errors, but when typing a long change…
Jonathan
Riyad KallaMemberHmm odd, can you give a small snippet as an example so I can reproduce this locally?
jhuangwebeliteMemberjust confirm
jhuangwebeliteMemberjon, you just need to put repository_user.xml to a jar file, and copy that jar file to lib folder. then delete
repository_user.xml -
AuthorPosts