Subject: Re: [xsl] Accessing input document from extension function loop (XSL 1.0) From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Fri, 15 Feb 2008 13:41:50 +0100 |
Michael Ludwig wrote:
From inside the xsl:for-each loop using the content generated by the extension function, I don't seem to be able to access my original input document. Am I mistaken here or is this assumption correct?
If it is correct, why is this so?
And is there a remedy?
You could use a global variable <xsl:variable name="main-doc" select="/"/> then you can access that variable as needed.
Thanks, Michael and Martin, your answers explained and solved the problem.
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:php="http://php.net/xsl" exclude-result-prefixes="php" xmlns:str="http://exslt.org/strings" extension-element-prefixes="str" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Channels"> <Urmel> <xsl:variable name="my-pointer" select="/Channels/Ch"/> <U4> <xsl:for-each select="str:split('ard zdf')"> <T3><xsl:value-of select="$my-pointer[ @ID = current() ]"/></T3> </xsl:for-each> </U4> <!-- <U5> <xsl:for-each select="php:function('gen_nodes', 'ard zdf')/*"> <T3><xsl:value-of select="$my-pointer[ @ID = current() ]"/></T3> </xsl:for-each> </U5> --> </Urmel> </xsl:template>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Accessing input document , Martin Honnen | Thread | [xsl] Grouping Problem, Eugene Bernard |
Re: [xsl] Extracting text between n, Colin Paul Adams | Date | [xsl] Grouping Problem, Eugene Bernard |
Month |