NXmlDocument Class Reference

NXmlDocument class abstracts the concept of a XML Document. More...

Inheritance diagram for NXmlDocument:

NObject

List of all members.

Public Member Functions

 NXmlDocument (const NString &rootElement)
 Constructs a NXmlDocument.
 ~NXmlDocument (void)
 Destroys a NXmlDocument object releasing any used resources.
void setRootNode (const NXmlNode &root)
 Sets the root node.
NXmlNode getRootNode (void)
 Returns a the root element.
const NXmlNode constGetRootNode (void) const
 Returns a const root element.
NXmlNode findNode (const NString &name)
 Finds a node in the document.
const NXmlNode constFindNode (const NString &name) const
 Finds a node in the document.
NXmlNode next (void)
 Once a node is found using findNode, this method returns the next node matching the search pattern.
const NXmlNode constNext (void) const
 Once a node is found using findNode, this method returns the next node matching the search pattern.
NXmlNode previous (void)
 Once a node is found using findNode, this method returns the previous node matching the search pattern.
const NXmlNode constPrevious (void) const
 Once a node is found using findNode, this method returns the previous node matching the search pattern.
void setEncoding (const NString &encoding)
 Sets the encoding of the XML Document.
NString getEncoding (void) const
 Gets the encoding of the XML Document.

Friends

class NXmlReader
class NXmlWriter


Detailed Description

NXmlDocument class abstracts the concept of a XML Document.
Examples:

ex_nxmlwrite.cpp, and xmlreader.h.

Definition at line 48 of file nxmldocument.h.


Constructor & Destructor Documentation

NXmlDocument ( const NString rootElement  ) 

Constructs a NXmlDocument.

Parameters:
rootElement The name of the root element

Definition at line 28 of file nxmldocument.cpp.

References NXmlDocument().

Referenced by NXmlDocument().


Member Function Documentation

void setRootNode ( const NXmlNode root  ) 

Sets the root node.

Parameters:
root The root node

Definition at line 74 of file nxmldocument.cpp.

NXmlNode getRootNode ( void   ) 

Returns a the root element.

Returns:
The the root element or a NULL NXmlNode object if not set
Examples:
ex_nxmlwrite.cpp.

Definition at line 79 of file nxmldocument.cpp.

Referenced by NXmlWriter::dump().

const NXmlNode constGetRootNode ( void   )  const

Returns a const root element.

Returns:
The root element or a NULL NXmlNode object if not set

Definition at line 84 of file nxmldocument.cpp.

NXmlNode findNode ( const NString name  ) 

Finds a node in the document.

Parameters:
name A XPath expression to match the name of the node
Returns:
The node or a NULL NXmlNode object if not set

Definition at line 128 of file nxmldocument.cpp.

References NDebug::print().

const NXmlNode constFindNode ( const NString name  )  const

Finds a node in the document.

Parameters:
name A XPath expression to match the name of the node
Returns:
A const node or a NULL NXmlNode object if not set

Definition at line 140 of file nxmldocument.cpp.

References NDebug::print().

NXmlNode next ( void   ) 

Once a node is found using findNode, this method returns the next node matching the search pattern.

Returns:
The node or a NULL NXmlNode object if not set

Definition at line 151 of file nxmldocument.cpp.

References NDebug::print().

const NXmlNode constNext ( void   )  const

Once a node is found using findNode, this method returns the next node matching the search pattern.

Returns:
The node or a NULL NXmlNode object if not set

Definition at line 163 of file nxmldocument.cpp.

References NDebug::print().

NXmlNode previous ( void   ) 

Once a node is found using findNode, this method returns the previous node matching the search pattern.

Returns:
The node or a NULL NXmlNode object if not set

Definition at line 174 of file nxmldocument.cpp.

References NDebug::print().

const NXmlNode constPrevious ( void   )  const

Once a node is found using findNode, this method returns the previous node matching the search pattern.

Returns:
The node or a NULL NXmlNode object if not set

Definition at line 186 of file nxmldocument.cpp.

References NDebug::print().

void setEncoding ( const NString encoding  ) 

Sets the encoding of the XML Document.

Parameters:
encoding The name of the encoding (UTF-8, ISO-8859-1, etc)


The documentation for this class was generated from the following files:
Generated on Wed Mar 5 23:10:37 2008 for NemesisUtilitiesSystem by  doxygen 1.5.4