I recently added some test to validate queries that return text nodes. 

        public void testGetMultipleTextNodes() throws Exception
        {
                String query = "//person/first/text()";

                Collection col = 
this.client.getCollection(TEST_COLLECTION_PATH);
                XPathQueryService xpathservice = (XPathQueryService) 
col.getService("XPathQueryService", "1.0");
                ResourceSet resultSet = xpathservice.query(query);

                ResourceIterator results = resultSet.getIterator();

                List res = asList(results);
                assertEquals(2, res.size());
        }

Internally two TextImpl nodes are returned to the server. The server puts
these into a result document and returns it.' As it returns it is
serialises the Result document to a text stream. This has the effect of
flattening the two text nodes into one and thus breaking the test (this
doesn't happen with the embeded driver).

Another related problem that effects both the embeded and xmlrpc dirvers
is that because the XmlResource implementations store their data
internally as strings you can't get a text node as a dom node.

I don't believe there is a quick solution to this problem and it may be
that the issue should be deffered until we have a 1.1 release out the
door.

My initial thought is to change the method we use to return the result set
from returning a simple dom to returning a custom xml structure. I also
think that we should split the results into pages on return (the
grabbing of the pages is handled by the iterator method). Anyway these are
just thoughts. Maybe I've missed something ... any suggestions?

-k. 

Reply via email to