xsl-list
[Top] [All Lists]

Re: 'apply-templates' on parameter of 'call-template'

2004-04-10 09:28:57
At 2004-04-10 11:47 -0400, Angus McIntyre wrote:
Just for the record, this

[the use of document('') to access the stylesheet as a source node tree]

works flawlessly on Xalan-J, LibXSLT and Saxon (invoked through TestXSLT), although the time to compile the stylesheet on the first attempt is noticeably longer with Xalan-J and Saxon than with most other stylesheets I've tested. Sablotron, on the other hand, doesn't like it at all. A cursory trawl through the logs makes it look as if something in 'expat' is blowing up (this is under MacOS X 10.3.3). I guess this technique, while presumably legal,

It is, indeed, very legal: XSLT 1.0 Section 12.1 "thus document("") refers to the root node of the stylesheet; the tree representation of the stylesheet is exactly the same as if the XML document containing the stylesheet was the initial source document."

is not necessarily safe for applications that are agnostic about the exact XSLT processor in use.

Unless they make a reasonable assumption they are using a conformant processor.

I get the feeling that while it's formally correct, it may be slightly 'bleeding edge' with respect to certain processor implementations.

This function has been specified since November 1999 ... I wouldn't really say that XSLT 1.0 is "bleeding edge" anymore ... it should be regarded as a reliable and stable tool in one's XML toolbox.

..................... Ken


--
Public courses: Spring 2004 world tour of hands-on XSL instruction
Each week:   Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO
Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18

World-wide on-site corporate, govt. & user group XML/XSL training.
G. Ken Holman                 mailto:gkholman(_at_)CraneSoftwrights(_dot_)com
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/s/bc