Subject: Re: Sablotron and PHP
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Fri, 14 Nov 2003 08:42:08 +0000
|
Hi Paul,
> Fair enough. Then, mostly for the benefit of anyone searching the
> archives, I'll just say: a number of limitations of XSLT and XPath 1
> can be overcome by use of scheme handlers if you're using PHP's XSLT
> functions via the Sablotron engine. The relevant function is
> xslt_set_scheme_handlers; it enables you to create custom functions
> to handle the document() function.
[snip]
> I wonder, tho, if other XSL engines have a similar callback
> capability.
Those XSLT processors that support the TrAX API (i.e. most of the Java
XSLT processors, including Saxon and Xalan) have this capability. You
can set the URIResolver of a Transformer object to anything that
implements the URIResolver interface. The URIResolver.resolve() method
takes a URI and a base URI and returns a Source object, which is used
to create the document node that is returned by the document()
function.
Of course, you have to make sure that the results returned for a
particular URI are stable during a particular transformation. And
using this technique can limit the portability of a particular
stylesheet to other XSLT processors or environments.
Cheers,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|