Hi,
I have a problem which I am currently solving using a temporary tree within
a variable, which I thought would allow me to process the contents of my
document multiple times.
For example:
<Root>
<IncompleteCopyInformation>
<Copy attr1="a" attr2="b"/>
<Copy attr1="c" attr2="d"/>
<Copy attr1="e" attr2="f"/>
</
<Body>
<h1>...</h1>
</
</
In my scenario, the CopyInformation isn't quite good enough, therefore I
need to run some XSLT to get some more information - this I stored in a
variable, which I then iterate through to provide multiple copies of the
body itself:
<xsl:variable name="Copies">
<CopyList>
<xsl:apply-templates select="/Root/IncompleteCopyInformation"
mode="ListGeneration" />
</CopyList>
</xsl:variable>
<xsl:tempalte match="Copy" mode="ListGeneration">
<ActualCopy>
... <!-- some logic going on here -->
</ActualCopy>
</xsl:template>
<xsl:template match="/">
<xsl:apply-templates select="$Copies"/>
</xsl:template>
<xsl:template match="ActualCopy">
<h1>Copy <xsl:number ... /></h1>
<xsl:apply-templates select="/Root/Body">
<xsl:param .... />
</xsl:apply-templates>
</xsl:template>
This doesn't work because when I attempt to apply-templates to /Root/Body,
the context appears to be limited to the variable - how can I get back to
the document?
This is largely academic, as I found a way around it by moving the copy
derivation code into a massive XPath, however interested to know if there is
a solution.
Thanks,
Tristan
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--