RE: valid node xmlparser oracle 10g

  • From: "Michael McMullen" <ganstadba@xxxxxxxxxxx>
  • To: "'Ian Cary'" <ian.cary@xxxxxxxxxxxxxx>
  • Date: Tue, 3 Nov 2009 10:21:38 -0500

Yes, it is odd, by the discussions we are having here. The whole xml isn't
done this way and it might just be the preliminary xml but people think it's
odd.

-----Original Message-----
From: Ian Cary [mailto:ian.cary@xxxxxxxxxxxxxx] 
Sent: Tuesday, November 03, 2009 10:16 AM
To: ganstadba@xxxxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx; oracle-l-bounce@xxxxxxxxxxxxx
Subject: RE: valid node xmlparser oracle 10g

Here is what you need

select extractvalue(x.xml_data,

'/n1:submit/requestHeader/ns5:language',

'xmlns:n1="ca/joe/test/autotype/submitrequest"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns="ca/joe/test/autotype/submitrequest"
xmlns:ns5="ca/joe/test/autotype/testcommonrequest"') omdata
from test_xml x;

OMDATA
----------------------------------------------------------------------------
----
English

I'm sure any xml experts on the list will correct me but isn't it a little
odd to have a separately defined namespace for each node in the path.

Cheers,

ian


|---------+----------------------------->
|         |           ganstadba@hotmail.|
|         |           com               |
|         |           Sent by:          |
|         |           oracle-l-bounce@fr|
|         |           eelists.org       |
|         |                             |
|         |                             |
|         |           03/11/2009 15:09  |
|         |           Please respond to |
|         |           ganstadba         |
|         |                             |
|---------+----------------------------->
 
>---------------------------------------------------------------------------
-----------------------------------|
  |
|
  |       To:       Ian Cary/ONS@ONS
|
  |       cc:       oracle-l@xxxxxxxxxxxxx
|
  |       Subject:  RE: valid node xmlparser oracle 10g
|
 
>---------------------------------------------------------------------------
-----------------------------------|




Thanks for the response, much appreciated.

I was able to get that out also, but I can't get out the single value
'English' from ns5:language

I'm trying variations of this
select
samplexml.xml.extract('n1:submit/requestHeader/ns5:language','xmlns:n1="ca/j

oe/test/autotype/submitrequest" requestHeader xmlns =
"ca/joe/test/autotype/submitrequest" xmlns:ns5
="ca/joe/test/autotype/testcommonrequest"').getStringVal() omdata
from
(select xmltype('<n1:submit xmlns:n1 ="ca/joe/test/autotype/submitrequest"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance";>
    <requestHeader xmlns = "ca/joe/test/autotype/submitrequest">
        <ns1:customerInteractionType xmlns:ns1 =
"ca/joe/test/autotype/testcommonrequest">ContactCentre</ns1:customerInteract

ionType>
        <ns2:serviceRequestUserId xmlns:ns2 =
"ca/joe/test/autotype/testcommonrequest">N296922</ns2:serviceRequestUserId>
        <ns3:serviceConsumer xmlns:ns3 =
"ca/joe/test/autotype/testcommonrequest">Odorrmax</ns3:serviceConsumer>
        <ns4:serviceRequestTimestamp xmlns:ns4
="ca/joe/test/autotype/testcommonrequest">2009-10-29T16:13:26.524-04:00</ns4

:serviceRequestTimestamp>
        <ns5:language xmlns:ns5
="ca/joe/test/autotype/testcommonrequest">English</ns5:language>
        <ns6:referenceID xmlns:ns6
="ca/joe/test/autotype/testcommonrequest">A26P83Z3</ns6:referenceID>
    </requestHeader>
    </n1:submit>') xml from dual) samplexml

-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx]
On Behalf Of Ian Cary
Sent: Tuesday, November 03, 2009 9:51 AM
To: ganstadba@xxxxxxxxxxx
Cc: mark-clist@xxxxxxxxxx; oracle-l@xxxxxxxxxxxxx;
oracle-l-bounce@xxxxxxxxxxxxx
Subject: RE: valid node xmlparser oracle 10g

Hi,

I loaded  the xml you sent into a 10g database here and ran;

select
extract(x.xml_data,'/n1:submit','xmlns:n1="ca/joe/test/autotype/submitreques

t"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance') omdata
from test_xml x


--
//www.freelists.org/webpage/oracle-l



This email was received from the INTERNET and scanned by the Government
Secure Intranet anti-virus service supplied by Cable&Wireless in
partnership with MessageLabs. (CCTM Certificate Number 2009/09/0052.) In
case of problems, please call your organisation's IT Helpdesk.
Communications via the GSi may be automatically logged, monitored and/or
recorded for legal purposes.


For the latest data on the economy and society consult National Statistics
at http://www.statistics.gov.uk

****************************************************************************
*****


Please Note:  Incoming and outgoing email messages are routinely monitored
for compliance with our policy on the use of electronic communications
****************************************************************************
*****


Legal Disclaimer  :  Any views expressed by the sender of this message are
not necessarily those of the Office for National Statistics
****************************************************************************
*****


The original of this email was scanned for viruses by the Government Secure
Intranet virus scanning service supplied by Cable&Wireless in partnership
with MessageLabs. (CCTM Certificate Number 2009/09/0052.) On leaving the GSi
this email was certified virus free.
Communications via the GSi may be automatically logged, monitored and/or
recorded for legal purposes.

--
//www.freelists.org/webpage/oracle-l


Other related posts: