XPath Problem - can't get the tag name of a node...
Posted: Sat Apr 14, 2007 9:18 am
hi all,
I'm using the XPath engine of MySQL 5.1 and I have the following XML structure:
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
I'm using the XPath engine of MySQL 5.1 and I have the following XML structure:
Code: Select all
<a>
<b>1</b>
<c>2</c>
<d>3</d>
</a>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