Oracle 11g: Extracting and Counting XML elements

Rajeshkumar

New Member
I have XML type data stored in an Oracle 11g database. A sketchy version of my data would look like this:\[code\]<?xml version="1.0" encoding="UTF-8"?><record><record_number>12345</record_number><record_type> book </record_type></record>\[/code\]Data manipulation functions such as:\[code\]SELECT XML_Type FROM Metadata\[/code\]specify the column where each row contains a well-formatted XML file (with many tags and elements). I am struggling to extract and count the number of occurrences for each \[code\]<record_type>\[/code\] element. For instance, I would like to know how many times the XML tag \[code\]<record_type>\[/code\] has the element 'book', 'article', etc. I do not know the entire list of elements associated to the tag , though. Thanks,I.
 
Back
Top