[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sub-tree filtering proposals



Juergen Schoenwaelder wrote:

> On Mon, Jun 07, 2004 at 10:23:17AM -0700, Andy Bierman wrote:
>  
>> How can multiple element and/or attribute selectors be combined?

I'm not sure, whether the question is about XPath in general or a proposed
specific subset/derivation functionality. In case of true XPath, I'd like
to add this information...

> As Joel M. Halpern already pointed out in private email, you can
> have multiple [] selections, for example:
> 
> //interface[type="ethernet"][connector="present"]

This kind of operation first builds the set of all <interface>s which is
then limited to those with type="ethernet" and this subset is then limited
to those with connector="present". This means a sequence of predicates is
not commutative, in contrast to the logical AND operator. An example where
this would be signifcant is this:
//interface[type="ethernet"][position()=last()] would address the last
ethernet interface, while
//interface[position()=last()][type="ethernet"] would address the last
interface, if it is an ethernet interface, otherwise an empty node set.

Xpath predicates (the parts in brackets) may contain boolean operators
("expr1 and expr2","expr1 or expr2", "not(expr)").


--
to unsubscribe send a message to netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>