Thursday, April 9, 2009

Committed to Apache Xerces


The Apache Xerces community granted me committer status for Apache Xerces2-J. The vote was called in just a few days back and it was officially closed on 8th of April (yesterday). Xerces2-J is an open source library for parsing, validating and manipulating XML documents. It is the most matured and most standard complaint XML parser available for Java applications today. 
Apache Xerces used to be a subproject of the Apache XML project but due to the immense popularity and high adoption rate that Xerces continued to exhibit, it became a top level project in year 2004. Presently Apache Xerces is a collection of four sub projects.
  • Apache Xerces C++
  • Apache Xerces2 Java
  • Apache Xerces Perl
  • Apache XML Commons
The original code base which formed the foundation of Xerces C++ and Xerces-J was developed at IBM and donated to ASF in year 1999. Therefore Apache Xerces happens to be one of the oldest projects of the ASF as well. In fact Xerces is nearly as old as the ASF itself and will be celebrating its 10th anniversary this November. Given all the facts and figures, it is indeed a great honour to be a part of such a majestic open source project :)
Talking about Apache Xerces2-J, it supports a large number of XML and XML related standards and APIs. The latest released version (2.9.1) supports the following specs.
  • XML 1.0 (4th Edition)
  • Namespaces in XML 1.0 (2nd Edition)
  • XML 1.1 (2nd Edition)
  • Namespaces in XML 1.1 (2nd Edition)
  • W3C XML Schema 1.0 (2nd Edition)
  • XInclude 1.0 (2nd Edition)
  • OASIS XML Catalogs 1.1
  • SAX 2.0.2
  • DOM Level 3 Core, Load and Save
  • DOM Level 2 Core, Events, Traversal and Range
  • JAXP 1.3
Due to the performance levels achievable through Xerces and its high level of standard compliancy, hundreds of open source projects and other commercial software applications make use of Xerces2-J. It is fair enough to say that Xerces2-J is the most widely used XML parser in the Java world. If you have a Java application which does some XML related stuff it's very likely that Xerces2-J is somewhere in your application's classpath. People sometimes use it even without knowing that they are actually using Xerces2-J. Sun Microsystems ships Xerces2-J with their JDK. This enables Sun JDK users to develop XML parsing applications powered by Xerces2-J without having to explicitly put the Xerces2-J jars in the project classpaths. However folks at Sun Microsystems have changed the Xerces2-J package name from org.apache.xerces.* to com.sun.org.apache.xerces.* which in my opinion is being a little ungrateful :(

Nowadays we are working on getting Xerces2-J to support the new XML Schema 1.1 specification from W3C. In fact I started contributing to Xerces2-J by implementing a XML Schema 1.1 feature as a Google Summer of Code participant, last year. I've been taking part in mailing list discussions and fixing bugs ever since. The Xerces2-J community is rather small but there's a very helpful and friendly bunch of experienced developers there, who have dedicated their lives and careers to Xerces. That encourages young developers like me to do more and more towards the betterment of the project, as and when the time permits.


1 comment:

sud said...

Thanks for posting details on the xerces project. I'm developing a Spring-WS application on the Sun JDK (1.6.0_13) and looks like it doesn't support the XSD 1.1 yet.

Do you know if this is true? I tried using the assert tag in the XSD to enforce a constraint and I get the following stacktrace:

Caused by: org.xml.sax.SAXParseException: s4s-elt-must-match.1: The content of 'UserUniqueRequest' must match (annotation?, (simpleType | complexType)?, (unique | key | keyref)*)). A problem was found starting at: assert.
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2537)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaError(XSDHandler.java:2528)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDAbstractTraverser.reportSchemaError(XSDAbstractTraverser.java:706)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDElementTraverser.traverseNamedElement(XSDElementTraverser.java:433)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDElementTraverser.traverseGlobal(XSDElementTraverser.java:214)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.traverseSchemas(XSDHandler.java:1258)
at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:579)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadSchema(XMLSchemaLoader.java:552)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:519)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.loadGrammar(XMLSchemaLoader.java:485)
at com.sun.org.apache.xerces.internal.jaxp.validation.XMLSchemaFactory.newSchema(XMLSchemaFactory.java:210)
at org.springframework.xml.validation.SchemaLoaderUtils.loadSchema(SchemaLoaderUtils.java:77)
at org.springframework.xml.validation.Jaxp13ValidatorFactory.createValidator(Jaxp13ValidatorFactory.java:40)
... 49 more