Reputation: 3930
Using MySQl, I am trying to use extractvalue
to find the value of an XML node's attribute. What should the extractvalue
command look like?
Example -
SET @xml = '<a>
<b thing="09876"></b>
</a>'
SELECT extractvalue(@xml,'???')
What would the command look like to display the value of 'thing'?
Upvotes: 1
Views: 970
Reputation: 39507
Add attribute::<attributename>
to the XPath:
SELECT extractvalue(@xml,'/a/b/attribute::thing')
Upvotes: 2