Subject: Re: [xsl] XPath expression which converts the output of path() into an abbreviated path? From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Wed, 17 Aug 2022 12:34:29 -0000 |
Hi Folks,just the last 3 names:
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
XPath expression which does it?
airports/airport/icaoCode
I can write a bunch of XSLT code that does this conversion. But is there an
Assuming we process only the result of path() it should be possible with tokenize and replace and string-join e.g.
string-join((('/Q{}AeroPublication[1]/Q{}airports[1]/Q{}airport[1]/Q{}icaoCod e[1]' => tokenize('/')) ! replace(., '^Q\{[^{]*\}|\[[0-9]+\]$', ''))[position() gt last() - 3], '/')
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XPath expression which co, Chris Papademetrious | Thread | Re: [xsl] XPath expression which co, Alan Painter alan.pa |
Re: [xsl] XPath expression which co, Chris Papademetrious | Date | Re: [xsl] XPath expression which co, Alan Painter alan.pa |
Month |