Wednesday, June 21, 2006

 

XML Validation and XPath Evaluation in J2SE 5.0

Java SE 5 has made it possible to use XPath expressions to pull out pieces of an XML document - without using any third-party software. Nothing is required to do it beyond JDK 1.5 and a knowledge of XPath expressions, which are a well-documented standard.

Another thing they have added in is a new Validator object for validating XML documents - and a Schema object that encapsulates a schema.

SchemaFactory class has a static method newInstance to identify what kind of SchemaFactory to produce. W3 Schema will always work.

It appears the intention is to let you specify other things too in the future. There have been a lot easier/more-powerful Schema standards out for almost half a decade.

XML Validation and XPath Evaluation in J2SE 5.0:
Some of the exciting new features of the Java 2 Platform, Standard Edition (J2SE) 5.0 release, code-named Tiger, are the added XML validation package at javax.xml.validation and the XPath libraries at javax.xml.xpath. Before the Tiger release, the Java API for XML Processing (JAXP) SAXParser or DocumentBuilder classes were the primary instruments of Java technology XML validation. The new Validation API, however, decouples the validation of an XML document from the parsing of the document. Among other things, this allows Java technology to support multiple schema languages. Let's take a closer look at XML validation first.

Glad to see the XML support in Java has improved a lot with JDK 1.5.

Technorati tags: , , , ,

Comments: Post a Comment



<< Home

This page is powered by Blogger. Isn't yours?