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

invalid xpath?

Subject: invalid xpath?
From: "Trevor Nicholls" <trevor@xxxxxxxxxxxxxxxxxx>
Date: Wed, 2 Jul 2008 22:23:49 +1200
 invalid xpath?
The following template errors in xsltproc and XMLSpy but appears to function
correctly when run by Saxon.

<!-- retain leading and trailing WS, remove line-breaks from the rest -->
<!-- special case for initial text, or text following <nl> element, when it
starts with a NL -->
<xsl:template name="KeepWS">
 <xsl:param name="Arg" select="." />
 <xsl:variable name="tArg">
  <xsl:choose>
   <xsl:when
test="preceding-sibling::*[1][self::nl][starts-with($Arg,'&#x0a;')]">
    <xsl:call-template name="WS">
     <xsl:with-param name="Arg" select="substring($Arg,2)" />
    </xsl:call-template>
   </xsl:when>
   <xsl:when test="not(preceding-sibling::*)[starts-with($Arg,'&#x0a;')]">
    <xsl:call-template name="WS">
     <xsl:with-param name="Arg" select="substring($Arg,2)" />
    </xsl:call-template>
   </xsl:when>
   <xsl:otherwise>
    <xsl:call-template name="WS">
     <xsl:with-param name="Arg" select="$Arg" />
    </xsl:call-template>
   </xsl:otherwise>
  </xsl:choose>
 </xsl:variable>
 <xsl:value-of select="$tArg" />
</xsl:template>

The xsltproc error is "XPath error: Invalid type"
XMLSpy says "Error in XPath expression, Not a node set"

I thought the test expressions are valid v1.0 XSL. Is this not so?

Cheers
Trevor

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.