CLAM-Development
1.4.0
|
This module contains classes to write an XML document following a "open on create - close on destroy" idiom. More...
Classes | |
class | CLAM::XmlFragment |
This is the first scoped object you should create for a XML fragment. More... | |
class | CLAM::XmlContent |
An scoped XML writer object inserting plain content to the current XML level. More... | |
class | CLAM::XmlElement |
An scoped XML writer object that opens a new element on construction and closes it on destruction. More... | |
class | CLAM::XmlAttribute |
An scoped XML writer object that inserts on construction an XML atribute to the last open XML element. More... |
This module contains classes to write an XML document following a "open on create - close on destroy" idiom.
That means that by simply creating an element object you are opening a tag and when the element object goes out of scope the element is automatically closed. The C++ stack frame managing rules assure that the XML will be well balanced.
This system only provides writing XML and has no mapping to CLAM data as CLAM::XmlStorage has. See the XmlStorage way .
Two aproaches can be convined to generate XML with scoped objects:
The first scoped object must be a top level one like XmlFragment (XmlDocument will be available soon). That element defines the target ostream where the XML will be written.
<MyTag /><Child />hello
instead the probably intended: <MyTag><Child>hello</Child></MyTag>
the correct code should be: