[XML4Lib] XPath: Selecting nodes grouped with parent?

Andrew Nagy andrew.nagy at villanova.edu
Tue Oct 31 17:35:30 EST 2006


Walker, David wrote:

>I've tried a couple of things. This returns ONLY those databases that have a type of Bibliography, but obviously doesn't include the subcategory parent nodes:
> 
>  //database[type = 'Biography']
> 
>This returns subcategory nodes that have a child database with the type of Bibliography, but it also includes ALL of the child nodes, regardless of whether they have a type of 'Bibliography' or not.
> 
>  //subcategory[database/type = 'Biography']
> 
>  
>
Are you looking for "Biography" or "Bibliography"?

What about:
/category/*[database/type = 'Bibliography'] ?
Just a guess.  I use a similar expression in a project I am currently 
working on.

Andrew


More information about the XML4Lib mailing list