Hi,
when I use the client/server interface and run a query that returns multiple nodes, BaseX appears to return the results concatenated (and, somewhat oddly, with interspersed newlines).
For instance,
xquery declare namespace atom='http://www.w3.org/2005/Atom'; doc('myfeed')//atom:title
returns:
<title xmlns="http://www.w3.org/2005/Atom">First Title</title> <title xmlns="http://www.w3.org/2005/Atom">Second Title</title> <title xmlns="http://www.w3.org/2005/Atom">Third Title</title> ....
Does anybody happen to know how to parse those into separate XML documents in Java? (Short of preprocessing the XML to find the matching end tag for each element?) For background, classes such as javax.xml.parsers.DocumentBuilder can only parse one document at a time, and throw an error if the input source contains multiple documents/fragments.
Alternatively, would it make sense for BaseX to support returning results one by one (perhaps using a cursor approach) to ease the client's task of parsing the returned XML?
- Godmar