dbTalk Databases Forums  

Small Problem with extract and XML data

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Small Problem with extract and XML data in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Kellerer
 
Posts: n/a

Default Small Problem with extract and XML data - 05-05-2006 , 04:14 AM






Hello,

here is the setup (smal test I created):

A table with a CLOB column (data) with the following content:

<root>
<child>Child 1</child>
</root>

SELECT data FROM theTable returns the above XML.

I get an error with the following expression:

SELECT extract(XMLType(data), '/root') FROM theTable;

ORA-31011: XML parsing failed

Looking at the example given in the Oracle manual, I would expect
<child>Child 1</child> to be returned.

The error description says "Check if the document to be parsed is
valid." but as far as I can tell the XML is valid (wellformed)

Strangely enough, the following is working:

SELECT extractvalue(XMLType(data), '/root/child') FROM theTable;

If the XML wasn't valid, this should fail as well, right?

What am I missing here?

This is with Oracle 9.2.0.7.0 running on a Linux box.

Regards
Thomas



--
It's not a RootKit - it's a Sony

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.