Class: REXML::Formatters::Transitive

Inherits:
Default show all
Defined in:
lib/extensions/rexml/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, ie_hack = false) ⇒ Transitive

Returns a new instance of Transitive.



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

def initialize( indentation=2, ie_hack=false )
  @indentation = indentation
  @level = 0
  @ie_hack = ie_hack
end