Summary: | Support XPath queries that return objects other than node sets. | ||
---|---|---|---|
Product: | Xindice | Reporter: | Kevin O'Neill <kevin> |
Component: | XPath | Assignee: | Xindice Developers <xindice-dev> |
Status: | CLOSED FIXED | ||
Severity: | enhancement | CC: | ysimmhan |
Priority: | P3 | ||
Version: | cvs head (1.1) | ||
Target Milestone: | --- | ||
Hardware: | Other | ||
OS: | other |
Description
Kevin O'Neill
2003-08-06 04:04:32 UTC
Fixed, Closed. Problem in XPathQueryResolver.ResultSet.prepareNextNode() when iterating over Collection and empty document i.e. '<?xml version="1.0" encoding="UTF-8"?>' is returned. Then the node returned by the document is null and a an exception is thrown at xp.execute(xpc, n, pfx) -- (exception attached at end). Checking for node != null fixes this problem. I'm not sure though how the empty document go into the DB in the first place. DBDocument d = (DBDocument) context.getDocument(keySet[keyPos++]); // dom2str(d) == "<?xml version="1.0" encoding="UTF-8"?>" if (d == null) { continue; } Node n = d.getDocumentElement(); // n == null if(n == null) continue; // added to fix the problem Exception thrown by xp.execute(xpc, n, pfx): java.lang.IllegalArgumentException: Node must be non-null for getDTMHandleFromNode at org.apache.xml.dtm.ref.DTMManagerDefault.getDTMHandleFromNode (DTMManagerDefault.java:543) at org.apache.xpath.XPathContext.getDTMHandleFromNode (XPathContext.java:220) at org.apache.xpath.XPath.execute(XPath.java:274) at org.apache.xindice.core.query.XPathQueryResolver$ResultSet.prepareNextNode (XPathQueryResolver.java:1211) at org.apache.xindice.core.query.XPathQueryResolver$ResultSet.getNextNode (XPathQueryResolver.java:1267) at org.apache.xindice.core.query.QueryUtil.queryResultsToDOM (QueryUtil.java:75) at org.apache.xindice.core.query.QueryUtil.queryResultsToDOM (QueryUtil.java:134) at org.apache.xindice.client.xmldb.embed.CollectionImpl.query (CollectionImpl.java:437) at org.apache.xindice.client.xmldb.XindiceCollection.query (XindiceCollection.java:259) at org.apache.xindice.client.xmldb.services.QueryService.query (QueryService.java:90) at edu.indiana.extreme.gsx.util.XindiceUtil.executeXPath (XindiceUtil.java:514) Thanks. --Yogesh Thanks for your observation. Can you also turn on DEBUG and see may be there are some ignored exceptions preceding this? Yogesh, any updates? Added test for null getDocumentElement() with log statement. |