Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::xml::XMLDOMParser Class Reference

A class that loads an entire XML document into memory and returns a tree of XML nodes. More...

#include <omXMLDOMParser.h>

Public Member Functions

Shared< XMLDocumentreadFile (const UTF8String &pathToFile) const
 Parse an XML file located at the specified path location in the local file system. More...
 
Shared< XMLDocumentreadString (const UTF8String &documentString) const
 Parse a memory-resident XML document string. More...
 
Bool writeFile (const Shared< XMLDocument > &document, const UTF8String &pathToFile) const
 Write the specified XML document to a file at the specified path in the local file system. More...
 
Bool writeString (const Shared< XMLDocument > &document, UTF8String &string) const
 Convert the specified XML document to a string, returned in the output parameter. More...
 

Detailed Description

A class that loads an entire XML document into memory and returns a tree of XML nodes.

This XML parser is suitable for small-scale XML file parsing or where access to the entire document is necessary by the end user. However, the document returned by this parser may require large amounts of memory if the XML file is large, since each element in the file must have an associated XMLNode object. If an XML file may be large (i.e. > 100MB), consider using the XMLSAXParser that is more memory efficient.

Member Function Documentation

Shared<XMLDocument> om::xml::XMLDOMParser::readFile ( const UTF8String &  pathToFile) const

Parse an XML file located at the specified path location in the local file system.

If the parsing succeeds, the method returns a pointer to an object representing the XML document. Otherwise, if the parsing fails, a NULL pointer is returned.

Shared<XMLDocument> om::xml::XMLDOMParser::readString ( const UTF8String &  documentString) const

Parse a memory-resident XML document string.

If the parsing succeeds, the method returns a pointer to an object representing the XML document. Otherwise, if the parsing fails, a NULL pointer is returned.

Bool om::xml::XMLDOMParser::writeFile ( const Shared< XMLDocument > &  document,
const UTF8String &  pathToFile 
) const

Write the specified XML document to a file at the specified path in the local file system.

The method returns whether or not the operation was successful.

Bool om::xml::XMLDOMParser::writeString ( const Shared< XMLDocument > &  document,
UTF8String &  string 
) const

Convert the specified XML document to a string, returned in the output parameter.

The method returns whether or not the operation was successful.


The documentation for this class was generated from the following file: