$(HIDE) rm -rf .libs
-timeXMLTree: $(CXXOBJECTS) XMLTree/XMLTree.a timeXMLTree.cpp
+timeXMLTree: $(CXXOBJECTS) XMLTree/XMLTree.a timeXMLTree.cpp testXMLTree.cpp
mkdir -p .libs/
cd .libs/ && ar x ../XMLTree/XMLTree.a
$(CXX) -o timeXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
$(CXX) -o myTimeXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
$(LIBS) myTimeXMLTree.cpp
+ $(CXX) -o testXMLTree $(CXXFLAGS) $(CXXINCLUDES) XMLDocShredder.o \
+ SXSIStorageInterface.o StorageInterface.o ./.libs/*.o \
+ $(LIBS) testXMLTree.cpp
rm -rf .libs
SXSIStorageInterface.o: SXSIStorageInterface.h SXSIStorageInterface.cpp StorageInterface.h
--- /dev/null
+#include "XMLDocShredder.h"
+#include "XMLTree.h"
+#include "Utils.h"
+
+
+void print_structure(XMLTree* tree, treeNode x){
+ DocID text;
+ if (x != NULLT){
+ std::cout << "Par idx: " << x << ", preorder: " <<
+ tree->NodeXMLId(x) << ", tag='" << tree->GetTagName(tree->Tag(x))
+ << "'\n";
+ text = tree->PrevText(x);
+ std::cout << "PrevText(" << x << ")= " << text
+ << ", value='" << ((text == NULLT) ? "" : (const char*)tree->GetText(text))
+ << "'\n";
+ text = tree->MyText(x);
+ std::cout << "MyText(" << x << ")= " << text
+ << ", value='" << ((text == NULLT) ? "" : (const char*)tree->GetText(text))
+ << "'\n";
+ text = tree->NextText(x);
+ std::cout << "NextText(" << x << ")= " << text
+ << ", value='" << ((text == NULLT) ? "" : (const char*)tree->GetText(text))
+ << "'\n";
+ print_structure(tree,tree->FirstChild(x));
+ print_structure(tree,tree->NextSibling(x));
+ };
+}
+
+int main(int argc, char** argv){
+ XMLTree * tree;
+ if (argc != 2){
+ std::cout << "Usage " << argv[0] << " filename.xml" << std::endl;
+ return 1;
+ };
+
+ XMLDocShredder shredder(argv[1],64,false,false);
+ shredder.processStartDocument("");
+ shredder.parse();
+ shredder.processEndDocument();
+ tree = (XMLTree *) shredder.storageIfc_->returnDocument();
+ print_structure(tree,tree->Root());
+ return 0;
+}