I have a table which contains x number of records. One of the fields is a CLOB and contains XML with a particular field Here is a very shortened version of the XML
<metadata xml:lang="en"
xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:srv="http://www.isotc211.org/2005/srv" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:gml="http://www.opengis.net/gml" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<gmd:GEMINI_Metadata>
<gmd:fileIdentifier>
<gco:CharacterString>cf40a39a-0721-4fd4-84f3-adc28aee1158</gco:CharacterString>
</gmd:fileIdentifier>
<gmd:dateStamp>
<gco:Date>2019-01-16</gco:Date>
</gmd:dateStamp>
</gmd:GEMINI_Metadata>
</metadata>
What I would like to do is get characterstring value from the fileIdentifier tag using SQL I have tried the following
select EXTRACT (XMLType (DOCUMENTATION), '//fileIdentifier//gco:CharacterString','xmlns:gmd="http://www.isotc211.org/2005/gmd"', 'xmlns:gco="http://www.isotc211.org/2005/gco"') as DOCUMENTATION from sde.gdb_items_vw where name = 'testTable'
i get the following
ORA-00939: too many arguments for function
If I try only specifying one tag and one namespace like this
select EXTRACT (XMLType (DOCUMENTATION), '//gmd:fileIdentifier','xmlns:gmd="http://www.isotc211.org/2005/gmd"') as DOCUMENTATION from sde.gdb_items_vw where name = 'testTable';
I get the following
DOCUMENTATION
--------------------------------------------------------------------------------
<gmd:fileIdentifier xmlns:gmd="http://www.isotc211.org/2005/gmd"><gco:CharacterS
So what is the correct way of getting a particular tag that has multiple namespaces within its tree?