You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xindice-dev@xml.apache.org by vg...@apache.org on 2004/02/24 17:52:56 UTC

cvs commit: xml-xindice/java/tests/src/org/apache/xindice/integration/client/services XPathQueryTest.java

vgritsenko    2004/02/24 08:52:56

  Modified:    java/src/org/apache/xindice/core/query QueryUtil.java
               .        status.xml
               java/tests/src/org/apache/xindice/integration/client/services
                        XPathQueryTest.java
  Log:
  Put <result> into Query namespace
  
  Revision  Changes    Path
  1.3       +6 -4      xml-xindice/java/src/org/apache/xindice/core/query/QueryUtil.java
  
  Index: QueryUtil.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/core/query/QueryUtil.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- QueryUtil.java	24 Feb 2004 15:44:01 -0000	1.2
  +++ QueryUtil.java	24 Feb 2004 16:52:55 -0000	1.3
  @@ -18,12 +18,14 @@
   
   package org.apache.xindice.core.query;
   
  +import org.apache.xindice.client.xmldb.XindiceCollection;
   import org.apache.xindice.core.data.NodeSet;
   import org.apache.xindice.util.XindiceRuntimeException;
   import org.apache.xindice.xml.NamespaceMap;
   import org.apache.xindice.xml.TextWriter;
   import org.apache.xindice.xml.dom.DBNode;
   import org.apache.xindice.xml.dom.DocumentImpl;
  +import org.apache.xindice.xml.dom.NodeImpl;
   
   import org.w3c.dom.Attr;
   import org.w3c.dom.Document;
  @@ -67,8 +69,8 @@
               if (element instanceof Attr) {
                   Attr n = (Attr) element;
   
  -                // FIXME: This should be namespaced element in XindiceCollection.QUERY_NS namespace
  -                Element holder = doc.createElement("result");
  +                Element holder = doc.createElementNS(XindiceCollection.QUERY_NS, "xq:result");
  +                holder.setAttribute(NodeImpl.XMLNS_PREFIX + ":xq", XindiceCollection.QUERY_NS);
                   holder.setAttributeNode((Attr)doc.importNode(n, true));
   
                   root.appendChild(holder);
  
  
  
  1.38      +2 -1      xml-xindice/status.xml
  
  Index: status.xml
  ===================================================================
  RCS file: /home/cvs/xml-xindice/status.xml,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- status.xml	24 Feb 2004 15:44:01 -0000	1.37
  +++ status.xml	24 Feb 2004 16:52:55 -0000	1.38
  @@ -71,7 +71,8 @@
           <release version="1.1b4-dev" date="February 24 2004">
               <action dev="VG" type="fix" fixes-bug="22156">
                   XPath query resulting in attribute nodes will return attributes
  -                on the &lt;result&gt; element.
  +                on the &lt;result&gt; element in http://xml.apache.org/xindice/Query
  +                namespace.
               </action>
               <action dev="VG" type="fix">
                   Fixed bug with DocumentImpl.importNode when importing attribute nodes.
  
  
  
  1.13      +5 -5      xml-xindice/java/tests/src/org/apache/xindice/integration/client/services/XPathQueryTest.java
  
  Index: XPathQueryTest.java
  ===================================================================
  RCS file: /home/cvs/xml-xindice/java/tests/src/org/apache/xindice/integration/client/services/XPathQueryTest.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- XPathQueryTest.java	24 Feb 2004 15:44:01 -0000	1.12
  +++ XPathQueryTest.java	24 Feb 2004 16:52:55 -0000	1.13
  @@ -270,7 +270,7 @@
               assertEquals(1L, resultSet.getSize());
   
               Node result = ((XMLResource) resultSet.getResource(0)).getContentAsDOM();
  -            assertEquals("foo", result.getChildNodes().item(0).getAttributes().item(0).getNodeValue());
  +            assertEquals("foo", result.getChildNodes().item(0).getAttributes().item(1).getNodeValue());
           } finally {
               client.removeDocument(TEST_COLLECTION_PATH, "doc3");
           }
  @@ -288,8 +288,8 @@
   
               Node result0 = ((XMLResource) resultSet.getResource(0)).getContentAsDOM();
               Node result1 = ((XMLResource) resultSet.getResource(1)).getContentAsDOM();
  -            assertEquals("foo", result0.getChildNodes().item(0).getAttributes().item(0).getNodeValue());
  -            assertEquals("bar", result1.getChildNodes().item(0).getAttributes().item(0).getNodeValue());
  +            assertEquals("foo", result0.getChildNodes().item(0).getAttributes().item(1).getNodeValue());
  +            assertEquals("bar", result1.getChildNodes().item(0).getAttributes().item(1).getNodeValue());
           } finally {
               client.removeDocument(TEST_COLLECTION_PATH, "doc3");
           }