Tools

1. Saxon!
2. XSLT 2 Implementation, Oracle
3. xinclude in xslt
4. Announce, XML testing tool

1.

Saxon!

DaveP

The first XSLT 2.0 implementation. Seems to have set the standard too? Saxonica for more information.

Two versions, one which understands Schemas, one which doesn't. One paid, one open source, link to it.

2.

XSLT 2 Implementation, Oracle

Steve Muench

(July 2004. DaveP)

While not yet as "reasonably complete" as Saxon, the Oracle10g XML Developer's Kit that you can download from oracle.com contains our in-progress implementation of XSLT 2.0 in it.

In case you were looking to work with multiple Java, XSLT 2.0 engines.

For example, I believe we've implemented the new grouping features, but not yet the ability to define functions in XSLT.

Just wanted to send up a flare that other major vendors are working on XSLT 2.0 implementations, too. Michael Kay's just a little more nimble with Saxon than we've been able to be so far! :-)

As we've done with XSLT 1.0, we'll ultimately offer both Java and C/C++ implementations of XSLT 2.0 as part of a future maintenance release of the Oracle XDK. Our inside-the-database XML DB functionality depends on the C implementation, for example, for XML parsing and XSLT transformation (among other things).

3.

xinclude in xslt

Erik Wilde

A while ago i was searching for an implementation of xinclude in xslt 2.0, and there was no such thing. since i needed it, i did implement it and would like to make it available now. it has the following restrictions:

- only xpointer barenames and the element() scheme are supported (both are required by the xinclude spec). the other xpointer schemes are not standardized anyway...

- xml:base fixup will always insert absolute uris. i found this to be more practical than using relative uris. both things are allowed by the spec, if required this could be made configurable.

- the content negotiation part (accept/accept-language) cannot be implemented in xslt, therefore these attributes are ignored.

- since parse="text" is implemented using unparsed-text(), the exact behavior of how to determine the character encoding cannot be controlled. however, xslt's behavior has been defined to be consistent with xinclude, so everything should be fine. but if there is a problem with reading the text document, there will be an xslt error instead of an xinclude error.

I have not yet done extensive testing, but some of the simpler examples of the test suites seemed to work just fine.

The xslt 2.0 stylesheet is available at drnet.net and can be freely used, it is licensed under the cc lgpl (which means, if you change it, you have to make your changes openly available under the lgpl as well).

4.

Announce, XML testing tool

Andrew Welch

A little utility I've been working on recently that I've called "xchecker" (I don't really like the name and I came up with it! at least its slightly better than the original of 'CheckXML'...)

xchecker allows you to:

- test XML (or the XML result of a transform) using XPath, XSLT, XSD, XQuery, Relax NG in combination. - embed XPath 2.0 checks (and others) in XML Schema

It can be downloaded from here: http://xchecker.sf.net/

The relevant topic is to use xchecker as a test framework for XSLT. To do that you create a Check Config with a transform subject:

<xchecker xmlns="http://xchecker.sf.net/";>

  <transform xml="xml/books.xml" xslt="xslt/books.xslt"
result="result/output.html">
    <check>/html/head/title = 'Books by publisher'</check>
    <check>exists(/html/head/meta)</check>
  </transform>

</xchecker>

xchecker will apply the transform (using Saxon) and then evaluate each <check> on the result. In order for a check to pass, xchecker looks for the following:

For XML Schema / Relax NG the document should validate
For XSLT / XQuery checks a single 'true' should be the result
For XPath a sequence of items can be returned with each one being 'true'

Any non-'true' values are returned as the failure message, so you can re-write your tests to be a little more informative in the event of a failure:

<check>if (/html/head/title = 'Books by publisher') then 'true'
              else concat('Unexpected title:', /html/head/title)</check>

...or some other inventive use of XPath. There's more info on the xchecker home page at http://xchecker.sf.net/