You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Adrian Mitev <ad...@googlemail.com> on 2009/02/11 12:43:17 UTC

[JXPath] Set a property in the whole graph

Hi all! I'm new to JXPath. Is there an easy way to traverse the entire
object graph and set all properties with name 'id' to null? Could not
find something similar in the user's guide.

-- 
Although nobody can come back and make a new start, anyone can start
now and make a new end

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [JXPath] Set a property in the whole graph

Posted by Matt Benson <gu...@yahoo.com>.
String xpath = "descendant-or-self::id";
for (Iterator<Pointer> it = context.iteratePointers(xpath); it
        .hasNext();) {
    it.next().setValue(null);
}

HTH,
Matt

--- On Wed, 2/11/09, Adrian Mitev <ad...@googlemail.com> wrote:

> From: Adrian Mitev <ad...@googlemail.com>
> Subject: [JXPath] Set a property in the whole graph
> To: user@commons.apache.org
> Date: Wednesday, February 11, 2009, 5:43 AM
> Hi all! I'm new to JXPath. Is there an easy way to
> traverse the entire
> object graph and set all properties with name 'id'
> to null? Could not
> find something similar in the user's guide.
> 
> -- 
> Although nobody can come back and make a new start, anyone
> can start
> now and make a new end
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail:
> user-help@commons.apache.org


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org