Re: Implementing XPointer Resolution With saxon:evalua
Hi Eliot, I'm a bit worried about this part of your xindrf:resolve-xpointer() function: > <xsl:variable name="direct-result-set" > select="saxon:evaluate($xpointer)"/> > <xsl:for-each select="$direct-result-set"> > <xsl:choose> > <xsl:when test="self::xindr:indirector and > ($indirector-treatment-str != 'as-resource')" > > <func:result select="xindrf:resolve-indirector(.)"/> > </xsl:when> > <xsl:otherwise> > <func:result select="."/> > </xsl:otherwise> > </xsl:choose> > </xsl:for-each> One of the rules about EXSLT function definitions is that the processor must only encounter one func:result instruction when evaluating the function body. This is to preserve the usual side-effect-free nature of XSLT (and is why func:result is called func:result rather than func:return). It looks to me here as if it could be possible for $direct-result-set to hold any number of nodes, which would mean that you would get multiple func:result instructions, which would be an error. To prevent that, you should use: <xsl:for-each select="$direct-result-set"> ... </xsl:for-each> or (if you want to be able to handle multiple points), rejig the code so that you use recursion to collect together all the nodes that you want to return from the function. Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format