[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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.")
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|