Skip to main content

JAXP and XSLT 2.0

3 replies [Last post]
mohitanchlia
Offline
Joined: 2006-04-24
Points: 0

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.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ivan_g_s
Offline
Joined: 2008-08-23
Points: 0

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.

mtv134
Offline
Joined: 2005-04-25
Points: 0

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

http://darwin-it.blogspot.com/2008/06/xslt-in-java-with-oracle-parser.html

The Amazing JAVA

rktumuluri
Offline
Joined: 2004-04-08
Points: 0

Check out

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.

/rk