XML validation
can also be done using the java API. A separate package is available
with all the available classes and methods. You need to use the package
javax.xml.validation if you want to use these classes.
_______________________________________________
_______________________________________________
As
with other XML processing the key to this validation also is to load
the XML document, you want to validate, in the Document object.
As a part
of creating a document object you would need to create a DocumentBuilderFactory
and then a DocumentBuilder. Then load the XML document you want to validate
into the Document object.
Now our
next task is to load the schema file to a schema object. For this you
need to create a SchemaFactory and then create a schema object to load
the schema file. Then the next step is to create a validator object
to validate the document source. The validator object has a validate()
method that is used to validate the document.
Software Review: XMLSpy 2008 From Altova (Blogcritics.org)
If you work with XML with any regularity then you need to do yourself a favor and check out XMLSpy 2008. XMLSpy 2008 is the latest version of Altova's integrated development environment (IDE) for XML. XMLSpy allows programmers to create XML-based applications and Web services in a more dynamic and easier to understand environment. The version that I am reviewing is XMLSpy 2008 release 2 which ...