W3C home > Mailing lists > Public > xsl-editors@w3.org > July to September 2004

Inconsistency between XPath 1.0 and XSLT 1.0 treatment of processing instruction initial whitespace

From: Elliotte Harold <elharo@metalab.unc.edu>
Date: Tue, 20 Jul 2004 09:13:46 -0400
Message-ID: <40FD1A8A.5000705@metalab.unc.edu>
To: xsl-editors@w3.org
Cc: xsl-list@lists.mulberrytech.com

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:

<xsl:template match="/">
   <xsl:processing-instruction name="testcase">
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
Received on Tuesday, 20 July 2004 09:11:19 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:44:23 UTC