|
Subject: Re: [xsl] XPath expression which converts the output of path() into an abbreviated path? From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 17 Aug 2022 12:40:14 -0000 |
On Wed, Aug 17, 2022 at 12:22:15PM -0000, Roger L Costello costello@xxxxxxxxx scripsit:
> 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?
(($path => tokenize('/'))[position() gt last() - 3] ! replace(.,'\[\p{Nd}+\]','') ! replace(.,'Q\{\}','')) => string-join('/')
An example of an XPath expression which is best stuffed in a function.
--
Graydon Saunders | graydonish@xxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor ("That passed, so may this.")
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] XPath expression which co, Martin Honnen martin | Thread | Re: [xsl] XPath expression which co, Norm Tovey-Walsh ndw |
| Re: [xsl] XPath expression which co, Alan Painter alan.pa | Date | Re: [xsl] XPath expression which co, Martin Honnen martin |
| Month |