.
[SXSI/xpathcomp.git] / XMLDocShredder.cpp
index 722c291..3daaf45 100644 (file)
@@ -106,8 +106,7 @@ void XMLDocShredder::processStartElement()
        
        if (empty){
            storageIfc_->newText("");  //myText
-           storageIfc_->nodeFinished(name);
-           storageIfc_->newText("");  //nextText
+           storageIfc_->nodeFinished(name);       
        };
 
 
@@ -131,7 +130,6 @@ void XMLDocShredder::processPCDATA()
          
        if (reader_->has_value())
        {         
-         storageIfc_->newChild("<$>");
          storageIfc_->newText(reader_->get_value());
          last_text = true;
        }
@@ -167,24 +165,22 @@ void XMLDocShredder::processAttributes()
                 
                else
                {
-                       storageIfc_->newChild(name);
-                       storageIfc_->newChild("<$>");
-                       storageIfc_->newText(value);
-                       storageIfc_->nodeFinished("<$>");
+                 storageIfc_->newText(""); //prevText
+                 storageIfc_->newChild(name);
+                 storageIfc_->newText(value);
+                 storageIfc_->nodeFinished(name);
                }
        }
        while (reader_->move_to_next_attribute());
+       storageIfc_->newText(""); //nextText
        storageIfc_->nodeFinished("<@>");
 }
 
 void XMLDocShredder::processSignificantWhitespace()
 {
-       ustring value = reader_->get_value();
-       
+       ustring value = reader_->get_value();   
        // each significant whitespace sequence constructs a text node
-       storageIfc_->newChild("<$>");
        storageIfc_->newText(value);
-
        
 }
 
@@ -199,6 +195,7 @@ void XMLDocShredder::processEndDocument()
 {
        /* tell the storage interface that document parsing has finished, and structures
         * can now be written to disk. */
+  storageIfc_->newText("");
   storageIfc_->nodeFinished("");
   storageIfc_->parsingFinished();      
 }
@@ -239,10 +236,8 @@ void XMLDocShredder::processCDATASection()
         */
   
        ustring value = reader_->get_value();
-       storageIfc_->newChild("<$>");
        storageIfc_->newText(value);
        last_text = true;
-       //      storageIfc_->nodeFinished();
 
 }