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

Re: XPath equivalent to xsl:apply-templates?

Subject: Re: XPath equivalent to xsl:apply-templates?
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 12 Jun 2022 21:03:53 -0000
Re:  XPath equivalent to xsl:apply-templates?
On Sun, Jun 12, 2022 at 08:22:25PM -0000, Roger L Costello costello@xxxxxxxxx scripsit:
[snip]
> The tricky element is mapping each military airport to commercial airports, i.e., for each military airport create an <airport> element in the commercial instance document:
> 
> <airports>
>     for $i in $ARPT.XML/ARPT/row return the result of applying the template rule for <airport> for $i
>     <airport>
>         <identifier>$ARPT_row/ICAO</identifier>
>         ....
>     </airport>
> </airports>
> 
> Obviously, "the result of applying the template rule for <airport> for $i" is not XPath; it's just English.
> 
> So my question is: what would be the XPath equivalent of "the result of applying the template rule for <airport> for $i"?

There isn't one.

While XPath 3.1 is formally a turing-complete language, there are a
whole bunch of things it doesn't makes sense to do with XPath.  Applying
templates might be three of them.

For inescapable reasons, the solution has to be at least as complicated
as the problem.

This sounds like a trivial problem to solve with templates; there's no
reason you can't generate the templates.  There's no reason you couldn't
generate a map of functions, either, especially if there's a relatively
small number of cases for the processing.

-- 
Graydon Saunders  | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

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.