>Is PsychoPath a Saxon replacement?

>The following statement appeared on the Apache ODE-Dev mailing list, in response to Antoine Toulme’s post about PsychoPath being in development and being re-licensed under an EPL license.

Nice to see an alternative to Saxon in development 🙂 In our case we would
probably still use Saxon until XSL is covered as well though

First let me say, that PsychoPath is not a replacement for Saxon. Saxon is a processor for both XSLT 2.0, XQuery 1.0, and XPath 2.0. The reason that it is able to support XSLT 2.0 and XQuery 1.0, is that the XPath 2.0 specification is used and extended by these languages. In particular XQuery 1.0 which can be viewed as an enhanced version of XPath. Most of the core language that people consider to be XQuery 1.0, is really XPath 2.0. The FLWR construct is an extension of the For…Return construct in XPath 2.0

So what are some of the reasons that somebody might want to potentially use PsychoPath’s implementation as opposed to the defacto standard that Saxon has become?

  • Once PsychoPath clear’s eclipse IP, commercial and open source adopters will have a fair comfort level with the IP cleanliness of the processor. Saxon unfortunately gives some IP lawyers the jitters. I personally think that Michael Kay has done an excellent job documenting his contributions but unfortunately it does not appease everybody. PsychoPath only had one main developer and no outside contributions, so it has fewer gotchas that could crop up. With this said, Psychopath is still undergoing IP review so something could slow it down.
  • Having an EPL licensed XPath 2.0 processor allows adopters to distribute the processor. Since ODE is hosted at Apache they have the same IP concerns that the Eclipse Foundation has, and have in the past not allowed distribution of Saxon with Apache code. The XML Beans framework leverages Saxon for some XQuery abilities, but does not distribute Saxon with the XML Beans product. Thus causing users to have to go and download it separately. A minor inconvenience but it does put off some people from adopting the framework.
  • PsychoPath is XML Schema Aware in its current form. Meaning that you can leverage XML Schema data types within your queries. Saxon-SA is not open source, and that is the only place where you get Schema Aware processing from Saxon.

With this said, there are several reasons to continue using Saxon.

  • Saxon is faster than PsychoPath in most cases. Michael Kay has done an excellent job in tuning his product and optimizing it.
  • Saxon-SA already passes 100% of the XQuery 1.0 Test Suite. The XQuery 1.0 Test Suite includes testing for the XPath 2.0 specifications. PsychoPath has not yet been run against this test suite, so there could be unforseen bugs in its implementation.
  • If you need XSLT 2.0 or XQuery 1.0 support, then PsychoPath is not what you want. PsychoPath only provides XPath 2.0 support. Compare it to Saxon’s XPath 2.0 processing support, or even how Xalan’s XPath 1.0 support is implemented. It can be used standalone to execute XPath statements.
  • PsychoPath currently does not implement an XPath 1.0 compatibility layer. It is strictly an XPath 2.0 processor.
  • Saxon is well established, and is actively developed and maintained. PsychoPath has been hibernating for several years, and is just now re-emerging. It’s going to take a while for PsychoPath to catch up in the XPath department.

As for the orginal author’s statement about XSLT support for PsychoPath. That really is not on the radar for PsychoPath. However, it could be used within a XSLT 2.0 implementation if somebody wanted to try and revive the dormant Xalan XSLT 2.0 implementation at Apache. I had desires at one time to try and revive this effort, but my priorities have changed. The code sits in the Apache SVN repositories, it just needs a group of individuals to pick up the reigns where they left off. I had done some brief tests with it and it seemed a fairly compliant implementation at the time, but definitely of beta quality.

So those are some of the reasons why PsychoPath might and might not be considered as a possible replacement if you are using Saxon strictly for XPath 2.0 processing. As far as my limited understanding of how ODE is using Saxon for XPath 2.0 processing, it would require rewriting the extension functions to use the PsychoPath function library API instead of the Saxon function library API. It’s not something that is trivial but it can be done.

This entry was posted in eclipse, xml, xpath. Bookmark the permalink.

2 Responses to >Is PsychoPath a Saxon replacement?

  1. Antoine says:

    >Dave, I was very happy to connect you to the ODE community. Good luck with the W3C test suite.

  2. David Carver says:

    >Thanks, Antoine. I just wanted make sure that ODE understood what PscyhoPath was focusing on. It’s not an XSLT 2.0 or XQuery 1.0 implementation.With that said, since it has a plugable parser framework, it could potentially be turned into or used to create an XQuery 1.0 implementation, by changing the parser and adding additional processing aspects.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s