combine (concat) two XPATH (path(.) and the text())

Questions about XML that are not covered by the other forums should go here.
mariomueller
Posts: 30
Joined: Wed Feb 14, 2018 3:27 pm

combine (concat) two XPATH (path(.) and the text())

Post by mariomueller »

Hi all,

I got two XPATH wich I which to concat
You can use the XML on https://www.w3schools.com/xml/books.xml

First XPATH gives back the Path of the nodes

Code: Select all

/bookstore/book/author/path(.)
Second XPATH gives back values

Code: Select all

/bookstore/book/author/text()
Is it possible to concat the results of both XPATH?

Many Thanks
Regards
Mario
HomeGoods
Posts: 96
Joined: Wed Feb 09, 2005 8:57 am

Re: combine (concat) two XPATH (path(.) and the text())

Post by HomeGoods »

You mean something this?

Code: Select all

/bookstore/book/author/(path() || text())
mariomueller
Posts: 30
Joined: Wed Feb 14, 2018 3:27 pm

Re: combine (concat) two XPATH (path(.) and the text())

Post by mariomueller »

Hi,

thanks. Works fine!
Regards
Mario
Post Reply