Pesho Posted April 14, 2007 Share Posted April 14, 2007 hi all, I'm using the XPath engine of MySQL 5.1 and I have the following XML structure: <a> <b>1</b> <c>2</c> <d>3</d> </a> What I want to extract is the tag name of the first child of <a>, e.g. I want to extract the value "b". I know I can access the <b> node as follows: SELECT EXTRACTVALUE(columnName,'/a/child::*[1]') from tableName; This gives me the fist child's text, e.g. "1", but I can't figure out how to get its tag name. I would be extremely grateful for any hint you could give! Regards, Pesho Link to comment https://forums.phpfreaks.com/topic/46996-xpath-problem/ Share on other sites More sharing options...
bubblegum.anarchy Posted April 14, 2007 Share Posted April 14, 2007 I got the following information from the mysql website: Note that ExtractValue() returns only CDATA, and does not return any tags that might be contained within a matching tag, nor any of their content (see the result returned as val1 in the following example). http://dev.mysql.com/doc/refman/5.1/en/xml-functions.html#function_extractvalue Link to comment https://forums.phpfreaks.com/topic/46996-xpath-problem/#findComment-229427 Share on other sites More sharing options...
Pesho Posted April 15, 2007 Author Share Posted April 15, 2007 yep, maybe that's impossible to do.... best, Pesho Link to comment https://forums.phpfreaks.com/topic/46996-xpath-problem/#findComment-229877 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.