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

Questions about XML that are not covered by the other forums should go here.
mariomueller
Posts: 29

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

Tue Jun 05, 2018 8:56 am

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: 87

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

Tue Jun 05, 2018 9:31 am

You mean something this?

Code: Select all

/bookstore/book/author/(path() || text())
mariomueller
Posts: 29

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

Tue Jun 05, 2018 12:17 pm

Hi,

thanks. Works fine!
Regards
Mario

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 0 guests