Class: REXML::Formatters::Transitive

Inherits:
Default show all
Defined in:
lib/rexml/formatters/transitive.rb

Overview

The Transitive formatter writes an XML document that parses to an identical document as the source document. This means that no extra whitespace nodes are inserted, and whitespace within text nodes is preserved. Within these constraints, the document is pretty-printed, with whitespace inserted into the metadata to introduce formatting.

Note that this is only useful if the original XML is not already formatted. Since this formatter does not alter whitespace nodes, the results of formatting already formatted XML will be odd.

Instance Method Summary collapse

Methods inherited from Default

#write

Constructor Details

#initialize(indentation = 2) ⇒ Transitive

Returns a new instance of Transitive.



15
16
17
18
# File 'lib/rexml/formatters/transitive.rb', line 15

def initialize( indentation=2 )
  @indentation = indentation
  @level = 0
end