Hi
I require some advice as to how to extract child element from XML fragment, where parent namespace differs from child namespace. I have researched wide and tried many options but have not had success.
Below is sample plsql fragment
vTheXML:= XMLType('<GeneratedDocument xmlns="http://tempuri.org/">
<FileName xmlns="http://services.dpm.com.au/intelledox/">Test.pdf</FileName>
</GeneratedDocument>');
The below successfully returns GeneratedDocument element (ie entire fragment)
vExtractXML:= vTheXML.extract('/GeneratedDocument', 'xmlns="http://tempuri.org/"');
But none of below work. These return null. I am not sure how to represent the different namespaces in XMLType extract function call
vExtractXML:= vTheXML.extract('/GeneratedDocument/FileName', 'xmlns="http://services.dpm.com.au/intelledox/"');
vExtractXML:= vTheXML.extract('/GeneratedDocument/FileName', 'xmlns="http://tempuri.org/" xmlns="http://services.dpm.com.au/intelledox/"');
vExtractXML:= vTheXML.extract('/GeneratedDocument/FileName', 'xmlns="http://tempuri.org/"');
Below does work, but ideally would like to use more precise XPath criteria
vExtractXML:= vTheXML.extract('//FileName', 'xmlns="http://services.dpm.com.au/intelledox/"');
Thanks