Welcome to WebmasterWorld Guest from 184.108.40.206
Forum Moderators: open
<name lang="en">half dollar</name>
What is the XPath expression that would give the name of the first attribute element of the first name element?
guessing this, but I am really not sure...
The solution would be to move the data from an attribute to an element, whose ordering parsers must obey.
For a few rants on the subject trying searching for "xml attribute ordering".
Looking at your example, it would seem natural for the "lang" element to be an attribute. Why can you not select for /purse/coin/name[@lang="en"]?
would probably work, however, this is for an assignment for a Java class. Our textbook is terribly brief and I cannot find a clear answer in it.
I think I need to use some other path statement that doesn't directly refer to the attribute by specifying the name.