I am using javax.xml.* packages and Java 1.5. But it looks like it doesn't support XSLT 2.0. Could somebody tell what I need to do to get XSLT 2.0 compatible parsers.
This is sad: There are no opensource AND fully compliant XSLT 2.0 processors (not for Java, not for any other language).
But there is more hope than before, that we will see such processor in next few years maybe: It's the new XQJ spec ( http://www.jcp.org/aboutJava/communityprocess/edr/jsr225/ ) for XQuery. XQuery relies on XPath 2.0 expressions and data model, so does XSLT 2.0.
Sadly, the EA-RI (early access reference implementation) of XQJ does not support anything related to XPath 2.0 yet. This RI is from oracle and some code inside is obfuscated (classes named just a, b, c, ...). Let's hope, that first serious opensource implementations of this spec will be fully compliant.
Opensource version of Saxon supports XQJ, but, no suprise there: without being schema-aware.
Let's think about it: A non-schema-aware XQuery processor. It's a joke.
Some 'statistics': First working draft on XSLT 2.0 was made in 2001, final release was 2007.
It's sadly a very complex thing. Same for XPath 2 and XQuery.
So I'm afraid, we have really to wait several years for the holy grail in Java-XML: A fully compliant, schema-aware, consistent API for XPath 1 and 2, XSLT 1 and 2, XQuery, XProc, ...
If Sun is not going to invest resources in this, first implementations will be seen in .NET, I'm afraid.
Use Oracle XML Parser
you will find the following post very helpful as the writer explained how to use Oracle XML parser to parse XML document using SXLT2
The Amazing JAVA
1) http://www.saxonica.com. They have XSLT 2.0 compliant "transformers". It's java based. However their "Schema Aware" processor is not-free.
2) http://www.altova.com/altovaxml.html. Windows only. They do seem to have a "java interface" though. XSLT 2.0 is supported alongwith XML Schema. (Schema Aware).
I have'nt tried these. So, do post your experience.
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners.