Home » Developer & Programmer » JDeveloper, Java & XML » how to extract xml data having namespace (oracle 9i (9.1))
how to extract xml data having namespace [message #579979] Mon, 18 March 2013 10:42 Go to next message
anoopmanagoli
Messages: 20
Registered: August 2012
Location: india
Junior Member
Hi all,

Below is the XML i have :

<?xml version="1.0" encoding="UTF-8" ?>
- <Transaction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.test.com/Support/Services/test1/2012" xsi:schemaLocation="http://schemas.test.com/Support/Services/test1/2012 Support.test1.v1.xsd">
- <Request>
<Memid>10</Memid>
<Actid>32</Actid>
<Pax>3</Pax>
<Flt>2012-DEC-10</Flt>
<Username>WebUserNameTest</Username>
</Request>
<Request>
<Memid>1</Memid>
<Actid>3</Actid>
<Pax>2</Pax>
<Flt>2012-DEC-12</Flt>
<Username>WebUserNameTest</Username>
</Request>
</Transaction>

I want to extract the element values :

The below code will help me when i have no namespace , what must be done in order to work with namespace and etract element value

v_string_xml :=
' //Request[' || TO_CHAR (counter_xml) || ']/Memid/text()';
v_ssp_table (v_ssp_table.COUNT).memid :=
p_xml_in.EXTRACT (v_string_xml).getnumberval ();


v_string_xml :=
'//Request[' || TO_CHAR (counter_xml) || ']/Actid/text()';
v_ssp_table (v_ssp_table.COUNT).actid :=
p_xml_in.EXTRACT (v_string_xml).getnumberval ();

v_string_xml :=
'//Request['
|| TO_CHAR (counter_xml)
|| ']/Pax/text()';
v_ssp_table (v_ssp_table.COUNT).pax :=
p_xml_in.EXTRACT (v_string_xml).getnumberval ();

v_string_xml :=
'//Request[' || TO_CHAR (counter_xml) || ']/Flt/text()';
v_ssp_table (v_ssp_table.COUNT).flt :=
p_xml_in.EXTRACT (v_string_xml).getstringval ();

v_string_xml :=
'//Request['
|| TO_CHAR (counter_xml)
|| ']/Username/text()';
v_ssp_table (v_ssp_table.COUNT).username :=
p_xml_in.EXTRACT (v_string_xml).getstringval ();




Re: how to extract xml data having namespace [message #579982 is a reply to message #579979] Mon, 18 March 2013 11:07 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
There are examples in this topic.

Regards
Michel
Re: how to extract xml data having namespace [message #580001 is a reply to message #579982] Tue, 19 March 2013 00:30 Go to previous message
anoopmanagoli
Messages: 20
Registered: August 2012
Location: india
Junior Member
Hi Micheal.. I been trying all possible and reading examples..

Just wanted to confirm from is it possible to extract with namespace in oracle 9i 9.1( version)


Previous Topic: Null argument
Next Topic: How to generate the XML string from the nested table
Goto Forum:
  


Current Time: Thu Mar 28 16:29:46 CDT 2024