3

I would like to use XPath 2.0, more specifically the distinct-values function. I downloaded the Saxon Home Edition because it can do XPath 2.0 and XSLT 2.0 but now it moans about not being able to invoke java stuff.

Cannot find a matching 1-argument function named {http://xml.apache.org/xslt/java}java.text.SimpleDateFormat.new(). Note that direct calls to Java methods are not available under Saxon-HE;

The built in processor in JRE has no problem with java expressions. Is there some way to mix Saxon-HE and the default JRE processor? Or is there some free processor that can do both?

Side question: Why is XPath 2.0 and XSLT 2.0 implemented so seldom? It's a few years old but all the big wig processors can't do it... :-(

Franz Kafka
  • 10,623
  • 20
  • 93
  • 149
  • 1
    On your side question: Developing an XSLT 2.0 processor might not be too profitable, especially when many people are asking for "some free processor". – Dimitre Novatchev Mar 31 '12 at 15:18
  • 1
    Saxon 9.1.0.8 is no longer available for download from the saxon sourceforge site. It is still available on the maven repo. http://mvnrepository.com/artifact/net.sourceforge.saxon/saxon/9.1.0.8 – Cheeso Jan 15 '13 at 18:53

2 Answers2

4

If you want to use Saxon 9 and extension functions you need to use one of the commercial editions or you need to use the new mechanism of integrated extension functions or you need to use Saxon 9.1 (still available). As for formatting dates, XSLT and XPath 2.0 have support for the schema data types xs:date and xs:dateTime and there are functions to format these, like http://www.w3.org/TR/xslt20/#format-date. As for support for XSLT and XPath 2.0, XPath 2.0 is a subset of XQuery 1.0, you should be able to find implementations for that beside Saxon. XSLT 2.0 is a complex specification and there are other implementations from IBM and Intel for instance, but not as open source projects.

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110
4

The answer to the second question (Why is XPath 2.0 and XSLT 2.0 implemented so seldom?) is implicit in your first - it's because of the economics of the software market - so many people would like to have everything for free, and that makes it hard to create a business case for developing the software.

If you can't afford the £50 for a Saxon Professional Edition license, you have the option to use "integrated extension functions" as Martin suggests, or to stick with Saxon-B 9.1 as Dimitre suggests.

Michael Kay
  • 156,231
  • 11
  • 92
  • 164