Question

in my company they have came up with their own xml that is being used as a schema for data, now i have to validate a xml according to that schema. is there any easy way to do it or i have to write from scratch?

i am working with java6...

thanks

Was it helpful?

Solution

One possibility is to create an XSLT transform that converts the homegrown schema document into a standard such as XML Schema or Relax NG.

OTHER TIPS

Check out Package javax.xml.validation , as of Java 5 the API supports validation for custom schema.

The SchemaFactory object has a method newSchema that will take a file and create a schema from it that can be validated against.

Edit: If you need to convert your XML file to a schema look at this question: Any tools to generate an XSD schema from an XML instance document?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top