/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Calibration/xmlBase/xmlBase-00-00-03/src/test/test_mem.cxx File Reference

#include "xmlBase/XmlParser.h"
#include "xmlBase/Dom.h"
#include <xercesc/dom/DOMElement.hpp>
#include <xercesc/dom/DOMNodeList.hpp>
#include <string>
#include <iostream>
#include <fstream>

Go to the source code of this file.

Functions

std::string doc_string ("<?xml version=\"1.0\" ?>""<!DOCTYPE TopElement ["" <!ELEMENT TopElement (ChildElt*) >"" <!ELEMENT ChildElt (ChildWithText | EmptyChild)* >"" <!ATTLIST ChildElt anAttribute CDATA #REQUIRED >"" <!ELEMENT ChildWithText (#PCDATA) >"" <!ATTLIST ChildWithText attr CDATA #IMPLIED>"" <!ELEMENT EmptyChild EMPTY> ]"">""<TopElement>"" <ChildElt anAttribute=\"I'm nested but empty\" />"" <ChildElt anAttribute=\"I'm nested with content\">"" <ChildWithText attr=\"text content\" >"" Text content here."" </ChildWithText>"" <EmptyChild />"" </ChildElt>""</TopElement>")
 Test program for xml facility. Parse xml file and write it out to a stream.
int main ()


Function Documentation

std::string doc_string ( "<?xml version=\"1.0\" ?>""<!DOCTYPE TopElement ["" <!ELEMENT TopElement (ChildElt*) >"" <!ELEMENT ChildElt (ChildWithText | EmptyChild)* >"" <!ATTLIST ChildElt anAttribute CDATA #REQUIRED >"" <!ELEMENT ChildWithText (#PCDATA) >"" <!ATTLIST ChildWithText attr CDATA #IMPLIED>"" <!ELEMENT EmptyChild EMPTY> ]"">""<TopElement>"" <ChildElt anAttribute=\"I'm nested but empty\" />"" <ChildElt anAttribute=\"I'm nested with content\">"" <ChildWithText attr=\"text content\" >"" Text content here."" </ChildWithText>"" <EmptyChild />"" </ChildElt>""</TopElement>"   ) 

Test program for xml facility. Parse xml file and write it out to a stream.

Referenced by main().

int main (  ) 

Definition at line 34 of file test_mem.cxx.

References doc_string(), and xmlBase::Dom::prettyPrintElement().

00034            {
00035  XERCES_CPP_NAMESPACE_USE
00036    
00037     xmlBase::XmlParser parser;
00038     
00039     DOMDocument* doc = parser.parse(doc_string);
00040     
00041     if (doc != 0) {  // successful
00042         std::cout << "Document successfully parsed" << std::endl;
00043         DOMElement* docElt = doc->getDocumentElement();
00044         xmlBase::Dom::prettyPrintElement(docElt, std::cout, "");
00045     }
00046     return(0);
00047 }


Generated on Tue Nov 29 23:14:53 2016 for BOSS_7.0.2 by  doxygen 1.4.7