Make your own free website on Tripod.com


XML Schema 1.1
 

W3C has completed work on the new version of XML Schema (XSD) language (Ver 1.1). XSD 1.1 became a W3C Recommendation on 5 April 2012.

The complete list of enhancements (a non-normative list, but fairly complete), that have been introduced in XSD 1.1 language is available here:
http://www.w3.org/TR/xmlschema11-1/#changes

Following are some of my thoughts about XML Schema 1.1:

1. XML Schema 1.1 support in Xerces

Xerces-J would be supporting XML Schema 1.1 in it's up-coming releases. The XML Schema 1.1 support in Xerces is actively under development. Many of the XML Schema 1.1 features are already implemented in Xerces, and lot of other features are under development.

The latest XML Schema 1.1 development branch can be accessed at, https://svn.apache.org/repos/asf/xerces/java/branches/xml-schema-1.1-dev/.

Incidentally I have been contributing a bit to the XML Schema 1.1 support in Xerces-J.
 
I've contributed primarily to following feature implementations in Xerces-J XSD 1.1 processor:
1) XSD 1.1 "assertions" (with support from Khaled Noaman, Michael Glavassevich & Ken Cai on Xerces side, along with Dave Carver & Jesper Steen Møller from PsychoPath XPath 2 team).
2) Some parts of Conditional Type Alternatives (full XPath 2 support -- integration with PsychoPath XPath 2 engine, and inheritable attributes integration. With support from Khaled Noaman, Michael Glavassevich & Hiranya Jayathilaka).
3) Implementation of XSD 1.1 xs:error data type.

Some of my blog posts about XSD 1.1 support in Xerces could be found at:
http://mukulgandhi.blogspot.com/search/label/xerces
Here's a post on Xerces wiki as well, http://wiki.apache.org/xerces/XML_Schema_1.1_Assertions.
 

2. JAXP enhancements for XML Schema 1.1 in Xerces

Xerces in future releases would be supporting JAXP 1.4. Currently Xerces (version, 2.9.1) supports JAXP 1.3 APIs.

Some design details about JAXP 1.4 support in Xerces are available at, http://wiki.apache.org/xerces/Xerces-J:_XML_Schema_1.1_Design_Thoughts.

Michael Glavassevich provided following code fragment (on, xerces-j-dev list) to invoke the Xerces XML Schema 1.1 processor using the JAXP 1.4 validation APIs:

import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import javax.xml.validation.Validator;

public class XMLSchema11Test {

    public static void main (String [] args) {
        try {
            System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/XML/XMLSchema/v1.1",
                    "org.apache.xerces.jaxp.validation.XMLSchema11Factory");
            SchemaFactory sf = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
            Schema s = sf.newSchema(new StreamSource(args[1]));
            Validator v = s.newValidator();
            v.validate(new StreamSource(args[0]));
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 

I tested the above code with latest Xerces SVN code, and it works perfectly well. I infact use this little program, to test my own XSD 1.1 schemas.
 


Useful references

*    http://www.w3.org/TR/xmlschema11-1/ (XML Schema Definition Language 1.1 Part 1: Structures), W3C Recommendation

*    http://www.w3.org/TR/xmlschema11-2/ (XML Schema Definition Language 1.1 Part 2: Datatypes), W3C Recommendation
 

Interesting articles / papers related to XML Schema 1.1

*    An introduction to XML Schema 1.1 (Part 1: Introduction)        IBM developerWorks
*    An introduction to XML Schema 1.1 (Part 2: Co-occurrence constraints using XPath 2.0)        IBM developerWorks
*    An introduction to XML Schema 1.1 (Part 3: Wildcard support enhancements, in XML Schema 1.1)        IBM developerWorks
*    XML Schema 1.1 pages by, Roger L. Costello                       
 



Home


Last Updated: Aug 25, 2012