On Fri, 17 May 2002 [EMAIL PROTECTED] wrote:

> Hi,
> 
> Good question - this is something I would also be very interested to know
> about ... So if anyone on this list knows how this could be implemented,
> please let us know..
> 

My knoledge about xindice and xml is very limited, but this is what I am going
to do:

Let's say that I have two collections A and B. Documents in collection A 
contains links to documents in collection B.

I need to make queries like (SQL presentation):

    SELECT colA.column2, colB.column3 FROM colA JOIN colB ON colA.Id=colB.aId
            WHERE colA.column1='Y' AND colB.column2='X'

So I first make XPath query which fetches documents from colA using only
node1='Y' (column1='Y' in SQL example) criteria. After that I use that first
resultset as a XmlSource for XSLT stylesheet like this (Pseudo code):

    FOR Each documentA in Source
       Fetch documentB from colB using link in documentA
       IF documentB meets node2='X' criteria then 
            combine document A and documentB and add combined document 
                    to XSLT resultset.
    NEXT

Fetching that documentB should be easy using JAXP 1.1 and
javax.xml.transform.URIResolver interface.

Offcourse this approuch has some drawbacks:

This solution is not very fast. In my project this kind of queries are
mostly made during nights and cached for daytime use. I am trying to design
my XML Schemas so that 'crosscollection' queries are needed only for
monthly reports.

Queries (XSLT stylesheets) are really hard to create runtime  based on user
input. Of course parameters like X and Y can be changed runtime.

Timo Kontro

Reply via email to