Quantcast

xpath and node deletion

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

xpath and node deletion

rvj-2

sometimes it appears to be easier to remove particular nodes from a document
than construct muliple xpath  nodes sets

is there any convention or method  for deleting nodes from a document so the
bulk of the document is returned?

   <root>

        <node  type=a">
                <leaf type="1"/>
                <leaf type="2"/>
        </node>
      <node  type=b">
                <leaf type="1"/>
                <leaf type="2"/>
        </node>


    </root>


and issue  something like  delete(//leaf[@type="2"]) to delete any   type 2
leaf element


_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: xpath and node deletion

rvj-2


... or is ALWAYS possible to construct an xpath expression which excludes
certain nodes

in other words to create the  inverse of an xpath?

    //* [@type!="2"]


eg select all elements except those with an attibute = 2


"rvj" <[hidden email]> wrote in message
news:[hidden email]...

>
> sometimes it appears to be easier to remove particular nodes from a
> document than construct muliple xpath  nodes sets
>
> is there any convention or method  for deleting nodes from a document so
> the bulk of the document is returned?
>
>   <root>
>
>        <node  type=a">
>                <leaf type="1"/>
>                <leaf type="2"/>
>        </node>
>      <node  type=b">
>                <leaf type="1"/>
>                <leaf type="2"/>
>        </node>
>
>
>    </root>
>
>
> and issue  something like  delete(//leaf[@type="2"]) to delete any   type
> 2 leaf element
>


_______________________________________________
dev-tech-xml mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-xml
Loading...