0 Replies Latest reply on Jun 29, 2011 6:54 AM by SrinivaschowdaryValluri

    Remove xml node based on value

    SrinivaschowdaryValluri

      Hi,
      we have to remove elements bases on the value.
      for example consider below xml

       

      <htl:room>
                <htl:ratePlan>
                  <htl:freeNights>12</htl:freeNights>
                  <htl:promoSavings>undefined</htl:promoSavings>
                  <htl:tax>undefined</htl:tax>
                </htl:ratePlan>
                <htl:guestAllocation>1,2</htl:guestAllocation>
              </htl:room>

       

      We have to remove elements with value undefined and should construct a new xml as below

       

      <htl:room>
                <htl:ratePlan>
                  <htl:freeNights>12</htl:freeNights>
                </htl:ratePlan>
                <htl:guestAllocation>1,2</htl:guestAllocation>
              </htl:room>

       

      please help.

       

      Thanks