logo
Main Page | Namespaces | Classes | Compounds | Files | Compound Members | Related

Utils::XMLDoc Class Reference

Class for representing a XML document. More...

#include <Utils.h>

List of all members.

Public Methods

 XMLDoc ()
 Constructor.

 ~XMLDoc ()
 Destructor.

void parseFile (std::string filename)
 Parses a XML (specified by 'filename') into a XMLDOC DOM structure.

vector< string > tagPartition (string s)
 split string into substrings


Public Attributes

XMLNoderootNode
 Toplevel node in document.


Detailed Description

Class for representing a XML document.

Typical Use:

 using namespace Utils;

 // Create empty XMLDoc.
 XMLDoc myDoc;

 try {

        // Read file from hard disk.
        myDoc.parseFile("text.xml");

        // Create a search class.
        XMLSearch noteFinder(myDoc); 

        // Match all notes starting with the following path:    
        // As it can be seen, a wildcard at the end is legal. This is the only place you can use for now!
        noteFinder.find("/xml/note*");

        // Iterate through them:
        for (int i = 0; i<noteFinder.query.size(); i++)
        {
                cout << noteFinder.query[i]->printString() << endl;;
        }
        
  } catch (parseError pE) {
        
        // Report errors.
        pE.print();
 }

Definition at line 252 of file Utils.h.


The documentation for this class was generated from the following files:
Syntopia Project. Visit the web page, or the SourceForge page.
Docs made by Doxygen. Email: Mikael Christensen