xsl-list
[Top] [All Lists]

RE: [xsl] id attribution in template match

2009-09-29 05:25:54
 

Since switching from DTD-based to XSD-based documents, a 
number of templates which make use of the id() function have 
stopped working. It's not a processor problem because it 
occurs with Xalan, Saxon and libxslt.

An XSLT 1.0 processor is unlikely to have any mechanism to recognize ID
types notified by a schema processor rather than a DTD processor. Indeed,
the XSLT 1.0 specification does not really give them any license to do so
(other than saying that you can construct the input data model any way you
like).

An XSLT 2.0 schema-aware processor will recognize ID types notified by a
schema processor: so with schema-aware Saxon, provided you validate the
input document using Saxon's schema processor, the types will be recognized.

However, I would encourage use of key() rather than id(). Even in a DTD
world, id() is excessively dependent on how the stylesheet is run. For
example, some parsers (System.Xml is a notable example) do not notify the
ID-ness of attributes to the application, and inserting a filter between the
parser and the XSLT processor will often lose the information.

Regards,

Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay 


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

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