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: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 17 Aug 2022 12:26:11 -0000
Hi Roger,

At the risk of having rotten produce thrown at me, I might consider a
replace() for this. It wouldn't be pretty (to remove the optional positional
predicates) but it would get the job done.

I'm sure there are better ways...


-----Original Message-----
From: Roger L Costello costello@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, August 17, 2022 8:22 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: [xsl] XPath expression which converts the output of path() into an
abbreviated path?

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

Current Thread