File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes Validating an xml with a Schema Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Validating an xml with a Schema" Watch "Validating an xml with a Schema" New topic

Validating an xml with a Schema

Clifton Craig
Ranch Hand

Joined: May 26, 2006
Posts: 103
I'm brand new to Schema validation so bear with me. I just learned that you can validate an XML document using the javax.xml.validation package in Java5. So now I'm trying it in a unit test. I'm trying to validate some generated XSL-FO with a schema I found here. I'm getting an error on the following line:

...where xslfoSchema is an input stream containing the contents of the schema that I downloaded. The error says:
Non-whitespace characters are not allowed in schema elements other than 'xs:appinfo' and 'xs ocumentation'. Saw '-- This schema was automatically generated by Syntext Dtd2Schema --'.
and the element in question is this one found in the document:

I'm thinking that this shouldn't happen but I don't know enough about XSDs to figure it out. Could someone help me?

Holla at me...<br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Validating an xml with a Schema