how to extract xml data having namespace [message #579979] |
Mon, 18 March 2013 10:42 |
|
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 ();
|
|
|
|
|