Getting element names using XPath/XQuery
20,322
/CD/*/name()
(padded out because StackOverflow doesn't like short answers)
![Lucy](https://i.stack.imgur.com/b2bT3.jpg?s=256&g=1)
Author by
Lucy
Updated on July 30, 2022Comments
-
Lucy almost 2 years
having the following XML sample document, I need to issue an XPath/XQuery expression to get the element names for every children of a CD element.
<CD> <TITLE>Empire Burlesque</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD>
So I need the query to return TITLE, ARTIST, COUNTRY, COUNTRY, PRICE, YEAR , any one can help please? thanks