jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Hagedorn <nachteilh...@gmx.de>
Subject XPath: check for property of child node
Date Thu, 11 Nov 2010 08:05:21 GMT

I am not very familiar with XPath and I am trying to build a query that 
selects nodes that have a grandchild with a specific name.

My structure is:

		<item name="item1">
				<aaa name="aaa" />
				<xxx name="xxx" />

		<item name="item2">
				<yyy name="yyy" />
				<aaa name="aaa" />

		<item name="item2">
				<ddd name="ddd" />
				<ccc name="ccc" />

What I want to do is to get all item nodes that have e.g. a "xxx" 

In my query I do:


It works, but it feels wrong. I would like to leave out the redundant 
property/attribute 'name'. But then I will have to check if children/xxx 
exists... and I don't know how to do it.

Could anyone please give me a hint?

Thanks in advance!


View raw message