Re: [xsl] XPath expression which converts the output of path() into an abbreviated path?

Subject: Re: [xsl] XPath expression which converts the output of path() into an abbreviated path?
From: "Joel Kalvesmaki director@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 18 Aug 2022 19:03:14 -0000
Here's another approach, if the XPath expression has icaoCode as the context. Forget about path(). Just string-join the local names of the ancestors and self, e.g.,

string-join(for $i in (ancestor-or-self::* except /*) return local-name($i), '/')

jk

On 2022-08-17 08:22, Roger L Costello costello@xxxxxxxxx wrote:
Hi Folks,

I am using the path() function and it is generating paths like this:

/Q{}AeroPublication[1]/Q{}airports[1]/Q{}airport[1]/Q{}icaoCode[1]

Now I want to convert that full path into an abbreviated path,
consisting of just the last 3 names:

airports/airport/icaoCode

I can write a bunch of XSLT code that does this conversion. But is
there an XPath expression which does it?

/Roger


-- Joel Kalvesmaki Director, Text Alignment Network http://textalign.net

Current Thread