problem with reading XML attributes and elements (split) [message #324874] |
Wed, 04 June 2008 07:08 |
zuntoo
Messages: 11 Registered: March 2007
|
Junior Member |
|
|
Kindly help extracting the 'Value' on (1), Position=2, as i get the below error, for the given XML.
select
extractvalue(xmltype(xmldata),'/ListOfHierarchyParams/HierarchyParams/
ListOfOrderItemXa/OrderItemXa[position()=2]/Name') from DUAL
ORA-19025: EXTRACTVALUE returns value of only one node.
<ListOfHierarchyParams>
<HierarchyParams>
<ListOfOrderItemXa>
<OrderItemXa>
<ActionCode>-</ActionCode>
<Name>GSM_PRPLAN</Name>
<Value>Economy</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
<OrderItemXa>--------------------(1), (position = 2)
<ActionCode>-</ActionCode>
<Name>GSM_MSISDN</Name>
<Value>12345678901</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
</ListOfOrderItemXa>
</HierarchyParams>
</ListOfHierarchyParams>
<ListOfHierarchyParams>
<HierarchyParams>
<ListOfOrderItemXa>
<OrderItemXa>
<ActionCode>Add</ActionCode>
<Name>CUG_GROUP_ID</Name>
<Value>1-1IUNEIR</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
<OrderItemXa>--------------------(2), (position = 2)
<ActionCode>Add</ActionCode>
<Name>CUG_GROUP_CD</Name>
<Value>Install</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
</ListOfOrderItemXa>
</HierarchyParams>
</ListOfHierarchyParams>
Thanks.
|
|
|
|
Re: problem with reading XML attributes and elements [message #324888 is a reply to message #324879] |
Wed, 04 June 2008 07:48 |
zuntoo
Messages: 11 Registered: March 2007
|
Junior Member |
|
|
SELECT Extractvalue(Xmltype('<ListOfHierarchyParams>
<HierarchyParams>
<ListOfOrderItemXa>
<OrderItemXa>
<ActionCode>-</ActionCode>
<Name>GSM_PRPLAN</Name>
<Value>Economy</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
<OrderItemXa>--------------------(1), (position = 2)
<ActionCode>-</ActionCode>
<Name>GSM_MSISDN</Name>
<Value>12345678901</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
</ListOfOrderItemXa>
</HierarchyParams>
</ListOfHierarchyParams>
<ListOfHierarchyParams>
<HierarchyParams>
<ListOfOrderItemXa>
<OrderItemXa>
<ActionCode>Add</ActionCode>
<Name>CUG_GROUP_ID</Name>
<Value>1-1IUNEIR</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
<OrderItemXa>--------------------(2), (position = 2)
<ActionCode>Add</ActionCode>
<Name>CUG_GROUP_CD</Name>
<Value>Install</Value>
<ListOfACSOossNumbers/>
</OrderItemXa>
</ListOfOrderItemXa>
</HierarchyParams>
</ListOfHierarchyParams>'),
'/ListOfHierarchyParams/HierarchyParams/
ListOfOrderItemXa/OrderItemXa[position()=2]/Name')
FROM Dual
|
|
|
|
|
|
|
|
|
|
|