[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

XPath equivalent to xsl:apply-templates?

Subject: 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
 XPath equivalent to xsl:apply-templates?
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.