File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes schema validation with xerces Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "schema validation with xerces" Watch "schema validation with xerces" New topic
Author

schema validation with xerces

Eugene Yusim
Greenhorn

Joined: Feb 13, 2004
Posts: 4
I am having a problem with schema validation using xerces 2.5.
I've got a main schema that includes (using xs:include) a 2nd schema which defines some types used in the main one. I set up an EntityResolver so both schemas are found by the parser.
I see the EntityResolver being called for both schemas and it opens up the correct file and creates and InputSource for the parser to use but the included schema is never used and I get errors saying that the types are not defined. If I paste the 2nd schema into the main one everything works.
I can even screw up the included schema to where it's not valid an xerces won't complain. It's like xerces completly ignores the included schema.
Is this just not supported by xerces or am I doing something wrong?
thanks.
Eugene Yusim
Greenhorn

Joined: Feb 13, 2004
Posts: 4
nevermind.
I realized I had an older version of xerces in my class path and this all works with 2.5.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: schema validation with xerces