commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Hughes <>
Subject Re: [JXPath] Questions about pointers, listeners & filters
Date Mon, 27 Apr 2009 13:50:38 GMT
I think I have a solution for both based on JXPath.

Cheers && a HUGE thank's to JXPath && Matt.

On Fri, Apr 24, 2009 at 12:09 PM, Andrew Hughes <> wrote:

> Hi All - probably just Matt tho   :)
> I've had some great results with JXPath, and I am now getting down to the
> nitty/gritty of what I am trying to achieve. Which is quite complex and I've
> no doubt that more experienced people than me exist in this area! Help is
> once again greatly appreciated!!!
> Background: I am dealing with dynamic objects (Nodes). Node's
> appear/disappear at runtime and are encapsulated in a heirarchy of HashMap's
> for JXPath's context bean. This works fantastic, but I have two remaining
> mandatory requirements.
> Requirement 1: Listening
> As a new node appears, listeners defined as expressions would like to know
> about this. For example, someone would like to know if a Ferrari ever
> appears in the context bean:  //Car[@name="Ferrari"]
> or /Transport/Vehicle/Car[@name="Ferrari"]. I believe that I should be
> testing is if the newly created/removed node/pointer is found in any of the
> supplied listening expressions? Ideally this can be done by traversing the
> minimal number of object's as possible - and could be too inefficient :'(
> for use.
> Requirement 2: Filtering.
> As a new node appear's I would like to know if I should include this node
> in the context bean hierarchy (i.e. addNewChild()) or ignore it. The
> criteria is if the new node is found using an expression (include or
> exclude). For example, if we don't deal with China then we might have an
> exclude expression /World/Asia/China or /World/Asia/*. Can I determine if
> the new node is within an includes/excludes expression without having to add
> the node to the context, then testing, then removing - becuase this has the
> potential to falsly invoke listeners in Requirement #1
> I'd like to know if there is any helpful functionality within jxpath that I
> am unaware of. I suspect there is
> As usual... I'm incredibly thankful for any help I can get :)

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message