On Dec 20, 2007 10:31 PM, Dan Diephouse <[EMAIL PROTECTED]> wrote: > I'm struggling a little bit to understand how to do a more complex > query. Let say I have a model like this: > > /blog > /blog/name = "Dan's Blog" > /blog/author = "Dan Diephouse" > /blog/entry > /blog/entry/title = "Jackrabbit" > /blog/entry/content .... > > I want to do a query where I select the blog node where /entry/title = > "Jackrabbit" OR /blog/author = "Dan Diephouse" > > In my own perverted SQL syntax: select /blog where author = "Dan > Diephouse" or entry/title = "Jackrabbit" > > I don't see how it's possible to create an SQL syntax where you test for > properties both on the node you're selecting and on it's child though. > Can anyone enlighten me? > > Thanks, > - Dan > > -- > Dan Diephouse > MuleSource > http://mulesource.com | http://netzooid.com/blog > >
Hi Dan! I don't think it will work in this format. I guess the only way to get this working is by using a query based on the node type (in case both /blog and /blog/entry share the same type or at least mixin) and then your query (XPath query) will be something like: //element(*, <common_type_or_mixin>)[EMAIL PROTECTED]'' OR @title=''] (this suggestions comes with no guarantees ;-), as I haven't tried it). ./alex -- .w( the_mindstorm )p.
