[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Inconsistency between XPath 1.0 and XSLT 1.0 treatment

Subject: 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
inconsistency between
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="/">
BEFORE
  <xsl:processing-instruction name="testcase">
This is the content of a PI
  </xsl:processing-instruction>
AFTER
</xsl:template>
</xsl:stylesheet>

In other words, the xsl:processing-instruction element appears able to create processing instructions that are not legal in the XPath 1.0 data model.

Advice and comments would be appreciated. If I'm not missing something here, an erratum or clarification might be called for.

--
Elliotte Rusty Harold

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.