Altova Mailing List Archives>Archive Index >xsl-list Archive Home >Recent entries >Thread Prev - >Thread Next - Re: [xsl] invalid xpath? [xsl] invalid xpath?To: Date: 7/2/2008 10:25:00 AM 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,'
')]"> <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,'
')]"> <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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
