Re: EXSLT str:split() and evaluation context

"James Fuller" <[email protected]> Sun, 30 Sep 2007 17:46:06 +0200
Newsgroups gmane.text.xml.xslt.extensions
Message-ID <[email protected]>
without looking to closely,


On 9/24/07, Michael Ludwig <[email protected]> wrote:

>       <xsl:for-each select="str:split('1 3')">

str:split takes 2 arguments

http://www.exslt.org/str/functions/split/str.split.html

check that you are using this as intended first.

hth, Jim Fuller


>   <!-- 1 --><xsl:value-of select="concat(local-name() , ' ')"/>
>   <!-- 2 --><xsl:value-of select="concat(. , ' ')"/>
>   <!-- 3 --><xsl:value-of select="/ur/bla[@nr = .]"/>
>   <!-- 4 --><xsl:value-of select="/ur/bla[@nr = 1]"/>
>   <!-- 5 --><xsl:value-of select="concat(. , '-', /ur/bla[@nr = .], ' ')"/>
>   <!-- 6 --><xsl:value-of select="concat(. , '-', /ur/@txt, ' ')"/>
>   <!-- 7 --><xsl:value-of select="concat(. , '-', $blub, ' ')"/>
>   <!--   --><xsl:text>&#10;</xsl:text>
>       </xsl:for-each>
>     </xsl:template>
>   </xsl:stylesheet>
>
> What strikes me is line 3 through 7. In line 3 through 6 I'm
> trying to reference the actual document in a for-each loop over
> the node set returned by str:split() - but to no avail. The original
> document seems inaccessible. On the other hand, the global variable
> $blub referenced in line 7 is accessible. Here is the output by both
> xsltproc and Xalan.
>
>     eins
>     token 1 1- 1- 1-Blubbel
>     token 3 3- 3- 3-Blubbel
>
> The evaluation context seems to be stuck on the node set provided by
> str:split() which is alien to the input document itself. Is this
> assumption correct?
>
> Is there any other way to access the original document in XSLT 1.0?
> Maybe using the XSLT document() function?
>
> Could anyone explain the rationale of all this? Why can I not access the
> original document tree whereas I can access the global variable?
>
> Is there any other way to use str:split() to produce a set of pointers
> in order to perform a lookup on the original document?
>
> Or is this an implementation issue xsltproc and Xalan happen to handle
> the same way?
>
> Any pointers welcome!
>
> Michael
> _______________________________________________
> exslt mailing list
> [email protected]
> http://www.exslt.org/list
>