Count XML nodes
763856Jun 1 2010 — edited Jun 4 2010Hello community,
I'm very new here and need your help:
What I have is an XML file in a table named "table_xml" with a column named "xml_file". The XML file looks like:
<head>
<row>...</row>
<row>...</row>
<row>...</row>
<row>...</row>
</head>
What I am trying to do is to count the XML nodes named "row". I use the 11g version of Oracle and it seems like I have to manage that with XMLTABLE, but I fail trying this. Could anyone please show me how to do that?
What could have work with former versions is:
SELECT count('/*/row')
FROM table_xml t , TABLE(XMLSequence(extract(t.xml_file,'/*/row'))) v
Thank you a lot in advace!