jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rakesh Vidyadharan <rak...@sptci.com>
Subject XPath question
Date Fri, 14 May 2010 14:56:21 GMT
Is it possible to filter based on parent node properties when executing an XPath query (JR
1.6).  Let me explain the scenario that I have.

We have a repository for all the books published by a press.  Each book has child nodes that
identify the various formats it has been published in (cloth bound, paperback, etc.) and are
termed as distributions.  All publication dates are associated with the distributions, since
the book really has no  publication date of its own.  Each book may belong to an array of
subjects, so the subjects are stored as a multi-value property in the book node.

The structure is something along these lines

    /A (alphabetical index as well as keep node count under control)
      /bo<Database PK value> <-- represents each book
        /distribution <- Container node for the various distributions
           /di<Database PK value> <-- represents a published format of the book

Example path for a distribution is: /books/book/T/bo5822950/distribution/di5822950

I need to generate RSS feeds of the new books (based on dates at the distribution node) as
well as  subject specific RSS for new books.  The XPath query for the new books is as follows:

//*[@nodeType = 'di' and @date > xs:dateTime('2010-03-13T17:29:50.050Z') and @date <=
xs:dateTime('2010-05-13T17:29:50.050Z') and @binding != 'ec0214db-8bb2-4f23-a925-341cd98196f7']
order by @date descending

Would it be possible in XPath to add some additional predicates to filter by subject at the
book node level?  I can iterate over the results and filter on parent.parent, but wondered
if it is possible in the query.

Thanks in advance for all hints and suggestions.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message