Validating xml against schema in java

If you want to try it out, you’ll find infinite number of resources.

validating xml against schema in java-47validating xml against schema in java-14validating xml against schema in java-24

Eventhough it took me a while to findout how to do it, it is actually pretty simple to do.

But its best to write it down somewhere so someone (which includes me) can next time find it out easily and understand it without problems. the xml file which you want to validate and the xsd file which you want to validate against), using the above function you can do it.

The purpose of the schema is to define the legal building blocks of an XML document.

It defines the document structure with a list of legal elements.

So we suggested some on-line resources where you can put in the XML and XSD and validate them and we mentioned the capability of open source tools too.

After a few days I got an answer that they are not able to validate our example XMLs against the provided Schema so I should give a better hint how we do that.That means the uppercase and lowercase are considered different eventhough they are the same words.The schema will take in to the case sensitivity in to consideration when validating.And because Microsoft is so kind and let everyone install a C compiler all-alone when needed I did not try to set up a C compiler, Cython and some other resources to compile the actual version of lxml on my computer.However on my Linux partition I have a 2.7.4 Python which is ideal for this little testing.But I’m currently curious about Python so I looked up how could I manage the same problem in the other programming language…