[xsl] Inconsistency between XPath 1.0 and XSLT 1.0 treatment of processing instruction initial whitespace
Subject: [xsl] Inconsistency between XPath 1.0 and XSLT 1.0 treatment of processing instruction initial whitespace|
From: Elliotte Harold <elharo@xxxxxxxxxxxxxxx>
Date: Tue, 20 Jul 2004 09:13:46 -0400
I've encountered an apparent discrepancy between how the
xsl:processing-instruction element behaves and the XPath 1.0 data model.
The XPath 1.0 data model specifically excludes leading white space from
the string-value of a processing instruction node:
The string-value <http://www.w3.org/TR/xpath#dt-string-value> of a
processing instruction node is the part of the processing instruction
following the target and any whitespace.
However, "The content of the |xsl:processing-instruction| element is a
template for the string-value of the processing instruction node." It is
an error if this template contains non-text nodes. However, it is not an
error if this template contains leading white space. For example, this
case from the OASIS Microsoft XSLT comformance test suite is legal:
This is the content of a PI
In other words, the xsl:processing-instruction element appears able to
create processing instructions that are not legal in the XPath 1.0 data
Advice and comments would be appreciated. If I'm not missing something
here, an erratum or clarification might be called for.
Elliotte Rusty Harold