On 07/29/10 04:30 PM, Jack Schwartz wrote:
> Hi Darren.
> 
> I agree that it is very useful to take a path.  The proposal you laid 
> out looks good.  I suggest an addition, based on a useful feature of 
> ManifestServ:  the ability to add values to the search, to narrow it down.
> 
> Suppose you have two elements of type X, one with value 1 and one with 
> value 2, and you want to retrieve the value of //X/Y but only for the 
> second X element.  Something like //X=1/Y could specify this.  (Pretty 
> sure that Xpath has a way to specify this kind of thing, though I don't 
> know it off hand.)

I think what you're suggesting is the addition of comparisons (or more generally
expressions) is that right?

This is kind of already there - since X is already the equivalent of
"name == 'X'" - if you want to do based on type, you need the '@' prefix:

        //x...@mytype

Honestly, I'm not sure at the moment about limiting based on anything more than
name or type right now - which is what the DOC API provides.

> 
> With the nested for loops, one could inspect and prune along the way 
> manually.  get_path() removes this inspection capability.  Adding a way 
> of specifying values in the path itself provides a convenient way to 
> restore this capability.

I can see where you're coming from, but I've a feeling this would add
considerable complexity to the functionality, which I'm not totally convinced is
required since there is always the fall-back to using the DOC API itself.

Thanks,

Darren.
_______________________________________________
caiman-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/caiman-discuss

Reply via email to