commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "liumin HU" <...@sigems.fr>
Subject Re: how it works jxpathcontext removeall?
Date Wed, 02 Jan 2008 08:13:18 GMT
hi,
yes, I am using 1.2 release.

liu
----- Original Message ----- 
From: "Matt Benson" <gudnabrsam@yahoo.com>
To: "Jakarta Commons Users List" <user@commons.apache.org>
Sent: Monday, December 31, 2007 5:00 PM
Subject: Re: how it works jxpathcontext removeall?


>
> --- liumin HU <lhu@sigems.fr> wrote:
>
>> hi everyone,
>>
>> I use jxpath to manage an ArrayList of bean, the
>> Context is created like: JXPathContext
>> context=JXPathContext.newContext(list);
>>
>> When I want to delete some objects in the arraylist,
>> i used  context.removeall, but it doesn't work.
>> Before and after call of removeall, the value of
>> count is always 1.
>>
>> context.getVariables().declareVariable("heure", _h);
>>
> System.out.println(context.getValue("count(/.[heureSelected=$heure])"));
>>  ====> 1.0
>> context.removePath("/.[heureSelected=$heure]");
>>
> System.out.println(context.getValue("count(/.[heureSelected=$heure])"));
>> ====> 1.0
>>
>> I tried too iterator.remove(), i got a exception.
>>
>> Iterator<HeurePrescription> iter =
>> context.iterate("/.[heureSelected=$heure]");
>>  while(iter.hasNext()){
>>      iter.next();
>>      iter.remove();
>>  }
>>
>> Any help is appreciated.
>>
>> Thanks in advance
>
> Are you using the JXPath 1.2 release?  There are
> innumerable bugfixes in svn trunk.
>
> -Matt
>
>>
>> Liu
>
>
>
> 
> ____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page.
> http://www.yahoo.com/r/hs
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message