Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Namespace preventing extraction of data from xml using XMLTABLE

550289Mar 28 2007 — edited Mar 28 2007
Hi 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 25 2007
Added on Mar 28 2007
4 comments
932 views