Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Small Problem with extract and XML data

Small Problem with extract and XML data

From: Thomas Kellerer <BDHLDUUTPRWS_at_spammotel.com>
Date: Fri, 05 May 2006 11:14:47 +0200
Message-ID: <4c0jc8F13i9arU1@individual.net>


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
Received on Fri May 05 2006 - 04:14:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US