vikas nakil

vikas nakil

  • NA
  • 8
  • 4.1k

how to parse the XML file having Same Element ?

Dec 13 2012 6:00 AM
I m struggling in parsing XML with same element, node,
I want to retrieve data from XML with same element

<CONTRACTINFO>
<PlanInfo>
      <PlanCode>ABD</PlanCode>
      <PlanDesc>ABD MNO</PlanDesc>
      <ServiceInfo>
        <ServiceCode>ABD1</ServiceCode>
        <ServiceDesc>AB1</ServiceDesc>
        <Outlets>1</Outlets>
      </ServiceInfo>
      <ServiceInfo>
        <ServiceCode>ABD2</ServiceCode>
        <ServiceDesc>ABD2</ServiceDesc>
        <Outlets>1</Outlets>
      </ServiceInfo>
      <ServiceInfo>
        <ServiceCode>ABD3</ServiceCode>
        <ServiceDesc>ABD3</ServiceDesc>
        <Outlets>1</Outlets>
      </ServiceInfo>
      <ServiceInfo>
        <ServiceCode>ABD4</ServiceCode>
        <ServiceDesc>ABD4</ServiceDesc>
        <Outlets>1</Outlets>
      </ServiceInfo>
    </PlanInfo>
</CONTRACTINFO>

---------------------------------------------------------------


<test>
<Accountno>46565</Accountno>
<CONTRACTINFO>
    <CustomerNo>20109087</CustomerNo>
    <ContractNo>1612665</ContractNo>
    <StartDate>11/30/2012</StartDate>
</CONTRACTINFO>
<CONTRACTINFO>
    <CustomerNo>20109088</CustomerNo>
    <ContractNo>1612666</ContractNo>
    <StartDate>11/30/2012</StartDate>
</CONTRACTINFO>
<CONTRACTINFO>
    <CustomerNo>20109089</CustomerNo>
    <ContractNo>1612667</ContractNo>
    <StartDate>11/30/2012</StartDate>
</CONTRACTINFO>
</test>

Answers (7)