xsl-list
[Top] [All Lists]

RE: Sablotron and PHP

2003-11-14 01:55:36
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.  Some ideas I've 
had since I stumbled across it:

- document('sql:SELECT * FROM mytable') to run an SQL query 
inside an XSLT stylesheet
- document('exists:myfile.xml') to see if a file exists
- document('calc:(-b+sqrt(4*a*c))/(2*a)') to perform 
arbitrary calculations
- document('seq:A-Z') to generate a sequence of letters or numbers

... but basically the sky's the limit.

Isn't this essentially the same as the URIResolver in the JAXP
interface?

Michael Kay


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>