Discussions

XML & Web services: Remove elements of DOM using XPAth

  1. Remove elements of DOM using XPAth (1 messages)

    Hi,

    I have below XML structure
    <Details>
    <Detail>
    <Name>A</Name>
    <Age>11</Age>
    </Detail>
    <Detail>
    <Name>B</Name>
    <Age>12</Age>
    </Detail>
    </Details>

    Structure may have many <Detail> elements.

    Now I want to remove all <Detail> elements which falls under a specific criteria (for ex: Name value ='A' or Age>15 etc.

    Do we have any API which allows me do this. Some thing like removeElement(document, XPath).

    Anirudha
  2. Hi Anirudha-

    The working draft of the XQuery update facility says that the XQuery update mechanism will provide DELETE support. I'm unsure, however, if there is any java implementation of an XQuery API which provides this, yet. You might try looking at the DataDirect XQuery Page.

    HTH,

    P