dan wrote:
In my case, my:document nodes refer to MULTIPLE "categories". I need to
support queries that say:
//element(*, my:document)
[ (jcr:deref(@my:cat1Ref, 'cat1Entry'))
(--- the document must refer to at least one of the 'category1'
entries)
And (jcr:deref(@my:cat2Ref, 'cat2Entry')/@my:text = 'cat2_Entry_2')
(--- the document must also refer to category2 entry, named
"cat2_entry_2")
And (jcr:deref(@my:cat3Ref, 'cat3Entry')/@my:text = 'cat3_Entry_x')
(--- the document must also refer to category3 entry, named
"cat3_entry_x")
]/jcr:deref(@my:cat1Ref, 'cat1Entry')/@my:text order by @my:text
Due to the query limitations, I had to gather all document nodes and
manually compile the list of referenced category entries.
Would you advise on some other approaches?
I'm not sure I understand your requirements correctly. I would simplify the
query by not using the jcr:deref() in the predicate (well, you can't anyway,
because it's not supported) but replace it with the uuid of the referenced
category. I assume that jcr:deref(@my:cat3Ref, 'cat3Entry')/@my:text =
'cat3_Entry_x' can be easily replaced because it points to a well known node or
at least limited set of nodes?
I'm also a bit confused whether you are finally interested in documents or
categories. The SQL query you posted earlier indicates that you are interested
in documents, but the above XPath query indicates that you are interested in the
referenced category text.
regards
marcel