Namespace preventing extraction of data from xml using XMLTABLE
550289Mar 28 2007 — edited Mar 28 2007Hi all,
I'm encountering a strange problem when extracting data from an xml document stored in an xmltype column. The xml doc:
<Person_GetResponse xmlns="http://ProgressWebService/FiskBrett.Co.UK/">
<Person_GetResult>
<Surname>Davro</Surname>
<Initials>B</Initials>
<Forenames>Bobby</Forenames>
<Salutation>Mr Davro</Salutation>
<LabelName>Mr Bobby Davro</LabelName>
<Email>BDavro@hotmail.com</Email>
</Person_GetResult>
<Person_GetResult>
<Surname>Flintstone</Surname>
<Initials>F</Initials>
<Forenames>Fred</Forenames>
<Salutation>Mr Fred Flinstone</Salutation>
<LabelName>Mr Fred Flinstone</LabelName>
<Email>FFlinstone@hotmail.com</Email>
</Person_GetResult>
</Person_GetResponse>
The following query works if I change the namespace to xmlns=""
SELECT
a.Surname "Surname"
FROM XMLTEST,
XMLTABLE('/*/Person_GetResult'
PASSING XMLTEST.xml_DOCUMENT
COLUMNS
Surname VARCHAR2(40) PATH '/*/Surname'
) a
How can I include the namespace in the query ? Any help would be much appreciated !
Regards
Greg