0

I have the following XML structure :

<Config>
  <DeviceFeatures>
    <IMEI>7844454564</IMEI>
    <PhoneNo>12354</PhoneNo>
    <ICCIDNo>455554</ICCIDNo>
    <IMSINo>87451</IMSINo>
    <UniqueDeviceId>360</UniqueDeviceId>
    <UserId>511154565@showcase.n</UserId>
    <Password>test123</Password>
    <Proxy>129.192.174.126</Proxy>
    <Proxy_Port>5060</Proxy_Port>
  </DeviceFeatures>
</Config>

And I want to delete all child nodes that come after the node <UniqueDeviceId></UniqueDeviceId>.

I want to delete the specific (UserId,Password,Proxy,Proxy_Port) nodes.

I've already tried the following :

DeviceFeatures.modify ('delete (/Config/DeviceFeatures/*)')

But it will delete all child nodes.

I've tried some other solutions and it seems not working at all, and I don't want to write multiple update statements to delete single nodes.

Does anybody know a possible solution for this scenario ?

Axel Isouard
  • 1,498
  • 1
  • 24
  • 38
mayurk
  • 121
  • 2
  • 11

1 Answers1

1

If you know the sequence, you can use

 DeviceFeatures.modify ('delete /Config/DeviceFeatures/*[position()>=6]')
podiluska
  • 50,950
  • 7
  • 98
  • 104
  • hi @podiluska thank you so much for quick help, u done really a great job!! and this is what i wants...:) – mayurk Sep 29 '12 at 05:07