Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_XmlDoc Class Reference
[eFLTK XML module]

The Fl_XmlDoc class represents the entire XML document. More...

#include <Fl_XmlDoc.h>

Inheritance diagram for Fl_XmlDoc:

Fl_XmlNode List of all members.

Public Methods

 Fl_XmlDoc ()
 Constructs an empty document, without doctype.

 Fl_XmlDoc (const char *name, const char *public_id=0, const char *system_id=0)
 Constructs an empty document, with doctype. More...

virtual ~Fl_XmlDoc ()
 Destroys object and free's all resources.

virtual void clear ()
 Destroys all nodes in document.

Fl_XmlNodecreate_element (const char *tagname)
 Creates new named node of type Fl_XmlNode::DOM_ELEMENT. More...

Fl_XmlNodecreate_text (const char *data)
 Creates new named node of type Fl_XmlNode::DOM_TEXT. More...

Fl_XmlNodecreate_comment (const char *data)
 Creates new named node of type Fl_XmlNode::DOM_COMMENT. More...

Fl_XmlNodecreate_CDATA_section (const char *data)
 Creates new named node of type Fl_XmlNode::DOM_CDATA_SECTION. More...

Fl_XmlNodecreate_PI (const char *target, const char *data)
 Creates new named node of type Fl_XmlNode::DOM_PI. More...

Fl_XmlDocTypedoctype ()
 Returns doctype of document. More...

const Fl_XmlDocTypedoctype () const
Fl_XmlNoderoot_node ()
 Returns pointer to root element of document.

void save (Fl_Buffer &buffer) const
 Save document to buffer. More...


Static Public Methods

int indent_spaces ()
 Returns indentation in save.

void indent_spaces (int i)
 Set indentation in save, defaults to 2. More...


Friends

class Fl_XmlParser

Detailed Description

The Fl_XmlDoc class represents the entire XML document.

It provides access to document root node, which includes all nodes in XML document tree.

Since elements, text nodes, comments, processing instructions, etc... cannot exist outside the context of a document, the document class also contains the factory functions needed to create these objects.

The node objects created have an document() function which returns document which is used to create it. Creation of elements, text nodes, etc... Is done using the various factory functions provided in this class.

Definition at line 143 of file Fl_XmlDoc.h.


Constructor & Destructor Documentation

Fl_XmlDoc::Fl_XmlDoc const char *    name,
const char *    public_id = 0,
const char *    system_id = 0
 

Constructs an empty document, with doctype.

Parameters:
name  of document.
public_id  of document, placed on DOCTYPE declaration
system_id  of document, placed on DOCTYPE declaration


Member Function Documentation

Fl_XmlNode* Fl_XmlDoc::create_CDATA_section const char *    data
 

Creates new named node of type Fl_XmlNode::DOM_CDATA_SECTION.

It can be added to document DOM tree.

Parameters:
data  content of CDATA section node
See also:
Fl_XmlNode

Fl_XmlNode* Fl_XmlDoc::create_comment const char *    data
 

Creates new named node of type Fl_XmlNode::DOM_COMMENT.

It can be added to document DOM tree.

Parameters:
data  content of comment node
See also:
Fl_XmlNode

Fl_XmlNode* Fl_XmlDoc::create_element const char *    tagname
 

Creates new named node of type Fl_XmlNode::DOM_ELEMENT.

It can be added to document DOM tree.

Parameters:
tagname  name of element
See also:
Fl_XmlNode

Fl_XmlNode* Fl_XmlDoc::create_PI const char *    target,
const char *    data
 

Creates new named node of type Fl_XmlNode::DOM_PI.

It can be added to document DOM tree.

Parameters:
target  is target of processing instruction
data  is data of processing instruction
See also:
Fl_XmlNode

Fl_XmlNode* Fl_XmlDoc::create_text const char *    data
 

Creates new named node of type Fl_XmlNode::DOM_TEXT.

It can be added to document DOM tree.

Parameters:
data  content of text node
See also:
Fl_XmlNode

Fl_XmlDocType& Fl_XmlDoc::doctype   [inline]
 

Returns doctype of document.

You can use it to add e.g. custom entities.

     mydoc->doctype().set_entity("myentity", "myreplacement");
     

Definition at line 217 of file Fl_XmlDoc.h.

void Fl_XmlDoc::indent_spaces int    i [inline, static]
 

Set indentation in save, defaults to 2.

Parameters:
i  as new indent spaces

Definition at line 234 of file Fl_XmlDoc.h.

void Fl_XmlDoc::save Fl_Buffer   buffer const
 

Save document to buffer.

Parameters:
buffer  as Fl_Buffer to save document


The documentation for this class was generated from the following file:
Generated on Thu Jul 31 15:33:57 2003 for eFLTK by doxygen1.2.15