version 3.3

VRS::XMLNamespaceAwareWriterUtil Class Reference

XMLWriterUtil provides simple static methods to write XML element tags. More...

#include <vrs/io/xmlnamespaceawarewriterutil.h>

Inheritance diagram for VRS::XMLNamespaceAwareWriterUtil:

VRS::XMLWriterUtil VRS::SharedObj VRS::Visitable

List of all members.

Public Member Functions

 XMLNamespaceAwareWriterUtil (std::ostream &target, int indentPerLevel=2)
 Creates an XMLWriter util that streams data into a given output stream.
void addInternalNamespaceMapping (const std::string &uri, const std::string &name)
void writeOpenTag (const std::string &elementName, SO< VRS::Iterator< XMLAttribute > > attributes=NULL, bool singleLine=false)
 Writes an XML open tag with the given attributes.
void writeOpenCloseTag (const std::string &elementName, SO< VRS::Iterator< XMLAttribute > > attributes=NULL)
 Writes an XML open tag that is closed without having any children (eg.
void writeCloseTag ()
 Writes an XML closing attribute for the currently open XML tag.
 VRS_TYPEINFO (XMLNamespaceAwareWriterUtil, XMLWriterUtil)


Detailed Description

XMLWriterUtil provides simple static methods to write XML element tags.

It is not needed for the implementation of DOM XML writers.


Constructor & Destructor Documentation

VRS::XMLNamespaceAwareWriterUtil::XMLNamespaceAwareWriterUtil ( std::ostream &  target,
int  indentPerLevel = 2 
)

Creates an XMLWriter util that streams data into a given output stream.

'indentPerLevel' specifies spacing ident that is left per hierarchy level, i.e., the root element has indent 0, the 1-level element has an indent of 'indentPerLevel'... This class also handles namespaces, i.e. it can replace the namespace of an incoming tag to match the current xml namespace definitions set by xmlns* attributes


Member Function Documentation

void VRS::XMLNamespaceAwareWriterUtil::addInternalNamespaceMapping ( const std::string &  uri,
const std::string &  name 
)

void VRS::XMLNamespaceAwareWriterUtil::writeOpenTag ( const std::string &  elementName,
SO< VRS::Iterator< XMLAttribute > >  attributes = NULL,
bool  singleLine = false 
)

Writes an XML open tag with the given attributes.

'attributes' may be NULL. If 'singleLine' is true, the whole element and any child elements are written in a single line until the closeTag is reached. This should be used for very short elements only.

void VRS::XMLNamespaceAwareWriterUtil::writeOpenCloseTag ( const std::string &  elementName,
SO< VRS::Iterator< XMLAttribute > >  attributes = NULL 
)

Writes an XML open tag that is closed without having any children (eg.

<tag a="b">) with the given attributes. 'attributes' may be NULL.

void VRS::XMLNamespaceAwareWriterUtil::writeCloseTag (  )  [virtual]

Writes an XML closing attribute for the currently open XML tag.

writeCloseTag() can only be called if an XML Open tag has been written.

Reimplemented from VRS::XMLWriterUtil.

VRS::XMLNamespaceAwareWriterUtil::VRS_TYPEINFO ( XMLNamespaceAwareWriterUtil  ,
XMLWriterUtil   
)


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

Generated on Wed May 23 06:00:19 2012 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact