|
Subject: [xsl] XPath equivalent to xsl:apply-templates? From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Sun, 12 Jun 2022 18:06:36 -0000 |
Hi Folks,
I have inserted XPath code into an XML document, e.g.,
<identifier>$ARPT_row/ICAO</identifier>
I wrote some code that extracts the XPath code and generates an XSLT
template:
<xsl:template match="airports/airport/identifier">
<xsl:param name="ARPT_row" tunnel="yes"/>
<identifier>
<xsl:value-of select="$ARPT_row/ICAO"/>
</identifier>
</xsl:template>
In some cases, I want to generate an XSLT template that has an
xsl:apply-templates, e.g.,
<xsl:template match="airports">
<xsl:param name="ARPT_row" tunnel="yes"/>
<airports>
<xsl:for-each select="$ARPT.XML/ARPT/row">
<xsl:apply-templates select="current()/*">
<xsl:with-param name="ARPT_row" tunnel="yes" select="."/>
</xsl:apply-templates>
</xsl:for-each>
</airports>
</xsl:template>
What XPath code to put in the XML document <airports> element:
<airports>???</airports>
The xsl:for-each can be replaced with the XPath "for" statement:
<airports>for $i in $ARPT.XML/ARPT/row return ???</airports>
Do you have suggestions for an XPath that results in generating
xsl:apply-templates?
Is there an XPath equivalent to xsl:apply-templates? (Not sure if that
question makes sense)
[As I recall Dimitre is working to show how every construct in XSLT can be
represented in XPath. Okay, Dimitre, what's the XPath equivalent of
xsl:apply-templates?]
/Roger
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| [xsl] [ANN] xspec-maven-plugin 2.1., Christophe Marchand | Thread | Re: [xsl] XPath equivalent to xsl:a, Dimitre Novatchev dn |
| Re: [xsl] return type of a function, Chris Papademetrious | Date | Re: [xsl] XPath equivalent to xsl:a, Dimitre Novatchev dn |
| Month |