A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Engineering
»
XML and Related Technologies
Author
How to validate XML against DTD
Ekaterina Galkina
Greenhorn
Joined: Sep 14, 2010
Posts: 15
posted
Sep 14, 2010 05:39:32
0
Hello,
I'm trying to validate XML against external XSD and DTD and using an example from here
http://faq.javaranch.com/java/HowToValidateXmlAgainstAnySchema
With XSD it's ok, but after I changed red lines in the following way:
factory.setAttribute( "http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/TR/REC-xml"); factory.setAttribute( "http://java.sun.com/xml/jaxp/properties/schemaSource", "file.dtd");
I get an exception
java.lang.IllegalArgumentException
: jaxp-order-not-supported: Property 'http://java.sun.com/xml/jaxp/properties/schemaLanguage' must be set before setting property 'http://java.sun.com/xml/jaxp/properties/schemaSource'
Could anyone explain me what does it mean? Thanks
I agree. Here's the link:
http://aspose.com/file-tools
subject: How to validate XML against DTD
Similar Threads
Help for warning: src-import.0: Failed to read imported schema document
Throws IllegalArguementException when validating XML with schema
Read File from jar file
xml parsing problem using xerces
Parse/Validate with DSIG schema issue
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter