Suppose we have this simple xml ...
<books>
<book>
<author/>
<title/>
</book>
<book>
<author/>
<title/>
</book>
</books>
I use this xpath to get the elements of the first copy of the book.
Returns
<author/>
<title/>
And this works fine, but I need to get it to work using local-name (). I tried the following, but none of these work ...
//*[local-name()='books']/*
this returns repeating author elements and titles, not good ones, I only need them from the first child
//*[local-name()='books'][0]/*
it returns nothing
Basically, I want to create a CSV file, so the first line in the output will be a heading that lists the names of the attributes of the book, followed by arbitrary data values. I only need to get part of the header.
author,title
john,The End is Near
sally,Looking for Answers