Viner, David wrote:

yes, and i should do this.  however, i first want to understand why the line
of code (doc.appendChild(root);) was commented out.


David,

I got that part. See comments I'd added in the XMLSerializable interface:
   /**
    * streamToXML streams a Java object to the DOM node.
    *
    * Passed owner document is used to create nodes and should not
    * be modified.
    *
    * @param doc The Owner Document
    * @return A newly created Element
    * @throws DOMException If an error occurs
    */
   Element streamToXML(Document doc) throws DOMException;


Basically, caller of the streamToXML method should add output to wherever is needed.



i don't want to
uncomment that line and have other functionality broken.


can someone explain what the comment means?
        * Usage of streamToXML seems to be vectored through
        * Collection.putObject(), which adds the element returned
        * by streamToXML to the document.  That makes the most sense
        * and should be an explicit part of the XMLSerializable contract.


Actually this was already de-facto contract. I just documented it.


once we get the code right, then i'll write the unit test.  (btw - is there
a good example unit test in our cvs? i'm not very proficient with junit.)


I'm preparing integration unit test and commit it soon... Ok, it is already in. There is one question though. It does not work till I make the following simple change:
Index: java/src/org/apache/xindice/core/meta/MetaData.java
===================================================================
RCS file: /home/cvs/xml-xindice/java/src/org/apache/xindice/core/meta/MetaData.java,v
retrieving revision 1.7
diff -u -r1.7 MetaData.java
--- java/src/org/apache/xindice/core/meta/MetaData.java 8 Aug 2003 13:29:24 -0000 1.7
+++ java/src/org/apache/xindice/core/meta/MetaData.java 8 Aug 2003 13:49:41 -0000
@@ -423,7 +423,7 @@
*/
public final Element streamToXML(Document doc) throws DOMException {


-        return streamToXML(doc, false);
+        return streamToXML(doc, true);
    }

    /**
@@ -539,7 +539,7 @@
     */
    public final void streamFromXML(Element source)
            throws DOMException {
-        streamFromXML(source, false);
+        streamFromXML(source, true);
    }

    /**


Can you explain why this parameter is false? This way, creation time and modification time are never stored in the collection storage. What did I miss here? I don't want to make this change till I hear from you.


Vadim




Reply via email to