Hi all,
I'm trying to parse this XML structure:
but the following line:
where initialDocument represents a DOMDocument with the XML posted above, only returns:
What am i doing wrong? Why does the first map disapear (the one were the service is 1954)?
How can i obtain the values for both the vars servicepackage and service?
TIA
I'm trying to parse this XML structure:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<parameter name="OfferMap" type="Map">
<parameter name="OtherMap" type="Map">
</parameter>
<parameter name="YetAnotherMap" type="Map">
</parameter>
<parameter name="Contract" type="Map">
<parameter name="OtherMap" type="Map">
</parameter>
<parameter name="VoiceGenOfferInfo" type="Map">
<parameter name="something" type="String">214</parameter>
<parameter name="something" type="String">214</parameter>
<parameter name="something" type="String">214</parameter>
<parameter name="something" type="String">214</parameter>
<parameter name="something" type="String">214</parameter>
<parameter name="something" type="String">214</parameter>
<parameter name="ServicesToActivate" type="Array">
<parameter type="Map">
<parameter name="ServicePackage" type="String">577</parameter>
<parameter name="service" type="String">1954</parameter>
</parameter>
<parameter type="Map">
<parameter name="ServicePackage" type="String">577</parameter>
<parameter name="service" type="String">1955</parameter>
</parameter>
</parameter>
</parameter>
</parameter>
</parameter>
but the following line:
Code:
initialDocument.getChildNodes().item(0).getChildNodes().item(5).getChildNodes().item(3).getChildNodes().item(13)
where initialDocument represents a DOMDocument with the XML posted above, only returns:
Code:
<?xml version="1.0"?>
<parameter name="ServicesToActivate" type="Array">
<parameter type="Map">
<parameter name="ServicePackage" type="String">577</parameter>
<parameter name="service" type="String">1955</parameter>
</parameter>
</parameter>
What am i doing wrong? Why does the first map disapear (the one were the service is 1954)?
How can i obtain the values for both the vars servicepackage and service?
TIA