DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22155>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22155 Support XPath queries that return objects other than node sets. [EMAIL PROTECTED] changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CLOSED |REOPENED Resolution|FIXED | ------- Additional Comments From [EMAIL PROTECTED] 2004-03-05 22:51 ------- 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