MySQL Forums
Forum List  »  Connector/Node.js

Re: Extracting XML attributes
Posted by: Bill Karwin
Date: August 29, 2006 11:16PM

It's unclear what part of the XML you want. MySQL 5.1 has a XML-parsing function called ExtractValue(). It takes a column that contains XML, and an XPath expression. For example:
SELECT ExtractValue(xml_column, '//LineItems/LineItem[1]/@ItemNumber') 
FROM ...

Returns the string "1", which is the value of the ItemNumber attribute for LineItem 1.

Bill K.

Options: ReplyQuote

Written By
August 07, 2006 11:40PM
Re: Extracting XML attributes
August 29, 2006 11:16PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.