Class XmlFormatter

Superclasses :
xml::Formatter
Subclasses :
xml::CanonicalXmlFormatter
Package :
xml

A formatter for XML documents. The default formatter behaviour is to output the string content as held in the children array (this may or may not have had whitespace removed depending on whether validation against a DTD occured), and without indentation.

Source

Class summary
Methods inherited from xml::Formatter
format(n, level)
Methods defined in this class
clear_as_read() clear_no_whitespace() clear_text_trim() format_cdata(n, level) format_comment(n, level) format_content(s, level) format_doctype(n, level) format_document(n, level) format_element(n, level) format_pi(n, level) format_xmldecl(n, level) get_children(el) set_as_read() set_indent(n) set_no_whitespace() set_text_trim()
Variables defined in this class
as_read indent no_whitespace text_trim

Method detail

clear_as_read()

Clear the as_read option (the default).
Source

clear_no_whitespace()

Clear the no_whitespace option (the default).
Source

clear_text_trim()

Clear the text_trim option (the default).
Source

format_cdata(n, level)

Overrides format_cdata(n, level) in xml::Formatter
Source

format_comment(n, level)

Overrides format_comment(n, level) in xml::Formatter
Source

format_content(s, level)

Overrides format_content(s, level) in xml::Formatter
Source

format_doctype(n, level)

Overrides format_doctype(n, level) in xml::Formatter
Source

format_document(n, level)

Overrides format_document(n, level) in xml::Formatter
Source

format_element(n, level)

Overrides format_element(n, level) in xml::Formatter
Source

format_pi(n, level)

Overrides format_pi(n, level) in xml::Formatter
Source

format_xmldecl(n, level)

Overrides format_xmldecl(n, level) in xml::Formatter
Source

get_children(el)

Source

set_as_read()

Configure the formatter so that the string content will be output as read from the input; ie the formatter uses the whitespace_children list rather than the children list.
Source

set_indent(n)

Ensure that each opening element appears with an indent of n chars. Whitespace will be inserted as appropriate. By default, no indentation is done.
Source

set_no_whitespace()

Configure the formatter so that whitespace-only string content will be discarded.
Source

set_text_trim()

Configure the formatter so that whitespace-only string content will be discarded, and in addition any other string content will be trimmed at both ends.
Source

Variable detail

as_read


indent


no_whitespace


text_trim