X-Git-Url: http://git.nguyen.vg/gitweb/?a=blobdiff_plain;f=XMLDocShredder.cpp;h=3daaf45dfbbcdc4a53cef508465a013e42d1d29f;hb=9be0c0e2a5597148fdc3a3cca2bdaf69da0aa27d;hp=f81251ed10ca6ada0c5a752f7c92d7815e173a5a;hpb=77294fdd983393727bcee7fda52dacdaf943e585;p=SXSI%2Fxpathcomp.git diff --git a/XMLDocShredder.cpp b/XMLDocShredder.cpp index f81251e..3daaf45 100644 --- a/XMLDocShredder.cpp +++ b/XMLDocShredder.cpp @@ -105,10 +105,8 @@ void XMLDocShredder::processStartElement() if (empty){ - DPRINT("Node " << name <<" is empty!\n") storageIfc_->newText(""); //myText - storageIfc_->nodeFinished(name); - storageIfc_->newText(""); //nextText + storageIfc_->nodeFinished(name); }; @@ -132,7 +130,6 @@ void XMLDocShredder::processPCDATA() if (reader_->has_value()) { - storageIfc_->newChild("<$>"); storageIfc_->newText(reader_->get_value()); last_text = true; } @@ -168,31 +165,29 @@ 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); - } void XMLDocShredder::processStartDocument(const string docName) { // tell storage interface to construct the document name - storageIfc_->newChild("ROOT"); + storageIfc_->newChild(""); } @@ -200,7 +195,8 @@ void XMLDocShredder::processEndDocument() { /* tell the storage interface that document parsing has finished, and structures * can now be written to disk. */ - storageIfc_->nodeFinished("ROOT"); + storageIfc_->newText(""); + storageIfc_->nodeFinished(""); storageIfc_->parsingFinished(); } @@ -240,10 +236,8 @@ void XMLDocShredder::processCDATASection() */ ustring value = reader_->get_value(); - storageIfc_->newChild("<$>"); storageIfc_->newText(value); last_text = true; - // storageIfc_->nodeFinished(); }