aspose file tools*
The moose likes XML and Related Technologies and the fly likes XMLSchemaValidation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XMLSchemaValidation" Watch "XMLSchemaValidation" New topic
Author

XMLSchemaValidation

jeya prabha
Greenhorn

Joined: Jun 03, 2008
Posts: 23
I am using DocumentBuilderFactory for XMLSchemaValidation.
how to set jaxp.properties file?
I am using this link http://www.onjava.com/pub/a/onjava/2004/09/15/schema-validation.html
using jaxp parser for validation.
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
If you are using a JDK that has a bundled JAXP implementation (i.e. parser in this case e.g. jdk 1.6, 1.5) you do not need to do anything.

However ff you want to use a different implementation than the bundled one then you have to choose one of the mechanisms set out in your link before the JVM falls back to the platform default, bundled implementation.

Have a look at this thread as well.

put the third party implementation in the class path.
create JAVA_HOME/jre/lib/jaxp.properties if it does not exist already.
in the file add the following line...
javax.xml.parsers.DocumentBuilderFactory=fully.qualified.classname.of.the.thirdparty.DocumentBuilderFactoryClass

But usually if the implementation is distributed in a jar the service mechanism in the jar is already set up. If you extract the jar and check the file META-INF/services/javax.xml.parsers.DocumentBuilderFactory you can verify this. In which case you only have to add the jar to the classpath.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XMLSchemaValidation