Answers in line.
Thanks for your thoughts. I've spent a few minutes looking at some of
the PsychoPath documentation, and I have a few questions and comments:
1. What is the form of the input accepted by PsychoPath? Is it
restricted to taking a DOM (Level 2?) input tree - whose nodes might
implement the ItemPSVI interface of the Xerces XML Schema API?
For XML Schema Awarness which PsychoPath supports, it requires
Xerces-J. For all other DOM's that are given to it, it defaults to just
the XPath core functionality. It currently requires a DOM Level 3
implementation, which the vast majority of DOM's out there now support.
2. Does PsychoPath expose its abstract syntax tree representation of
XPath expressions? I ask this because patterns in XSLT pose a special
problem. A pattern like a/b/c is most conveniently evaluated as
self::c[parent::b/parent::a] - and making that kind of transformation
is most conveniently performed on the abstract syntax tree
representation of the expression. So in order for Xalan-J to use
PsychoPath to perform XPath evaluation efficiently, it would probably
need to have access to the abstract syntax tree representation. That
entails a higher degree of coupling than I think would be possible by
having Xalan-J simply using the PsychoPath user API.
Yes, the tree is exposed, but probably not in an ideal way. Patches
and contributions are always appreciated. You can always use the
internal API, but we are looking at making a true API next year, so
input would be greatly appreciated...along with patches and unit tests. :)
Similarly for XSLTC, though having the XSLT Java byte code generation
rely on PsychoPath to perform the XPath byte code generation would
certainly be possible, I think there would be a need to have
PsychoPath expose very specialized interfaces for byte code generation
that no casual user would be interested in.
File a bug report or enhancement request with the particular
requirements and we can look at adding them.
3. Does PsychoPath expose facilities for plugging in user-defined
functions? Such a facility would be needed to allow an XSLT processor
to define stylesheet functions that could be used within XPath
expressions. Then of course there are other functions in XSLT that
could be invoked from an XPath expression in a stylesheet, some of
which are affected by declarations in the stylesheet: key,
format-number, etc.
Yes, you can create user defined functions. Psychopath uses the same
library and API for defining all the XPath functions. Adopters can
extend the functionality through the same API that psychopath uses itself.
I would encourage anybody that thinks we are missing something in
PsychioPath to file an enhancement request or bug. We are currently in
a API freeze right now, but will be starting up development on the next
version of PyschoPath in July, so now is a great time to get in
enhancement requests and feature requests.
Dave