Create Result Set without Iterator

"Pasche" <[email protected]> Wed, 7 Sep 2005 13:04:31 +0200
Newsgroups gmane.text.xml.xindice.user
Message-ID <[email protected]>
As you can see the Xindice-query returns a result with more than one
document. These documents are transformed into a DOMSource Object which is
used to transform the documents with an XSLT stylesheet. It was hard for me
to get this transformation working. In my example only the last result of
the xindice query will be used for the transformation. Is it possible to put
all result elements into the src-object? I know that I don´t need the
ResourceIterator but I don´t know how to solve the problem without it.

 

XPathQueryService service        = (XPathQueryService)
col.getService("XPathQueryService", "1.0");

ResourceSet resultSet              = service.query(xpath);

ResourceIterator results             = resultSet.getIterator();

 

while (results.hasMoreResources())

{           

                        /* Element des ResourceIterators in DOMSource
umwandeln */

                        XMLResource res1        = (XMLResource)
results.nextResource();

                        Node node                    =
res1.getContentAsDOM();   

                        DOMSource src            = new DOMSource(node);


            }

………

transformer.transform(src, res);

 

 

 

-----

JasDA