Re-fixes ticket:115
Adds a unit test to help prevent regressions.
3 files changed, 18 insertions(+), 9 deletions(-)

M src/rexml/document.rb
M src/rexml/formatters/transitive.rb
M test/core_test.rb
M src/rexml/document.rb +9 -8
@@ 10,6 10,7 @@ require "rexml/output"
 require "rexml/parsers/baseparser"
 require "rexml/parsers/streamparser"
 require "rexml/parsers/treeparser"
+require "rexml/formatters/transitive"
 
 module REXML
   # Represents a full XML document, including PIs, a doctype, etc.  A

          
@@ 184,14 185,14 @@ module REXML
         output = Output.new( output, xml_decl.encoding )
       end
       formatter = if indent > -1
-          if trans
-            REXML::Formatters::Transitive.new( indent, ie_hack )
-          else
-            REXML::Formatters::Pretty.new( indent, ie_hack )
-          end
-        else
-          REXML::Formatters::Default.new( ie_hack )
-        end
+		if transitive
+		  REXML::Formatters::Transitive.new( indent, ie_hack )
+		else
+		  REXML::Formatters::Pretty.new( indent, ie_hack )
+		end
+	  else
+		REXML::Formatters::Default.new( ie_hack )
+	  end
       formatter.write( self, output )
 		end
 

          
M src/rexml/formatters/transitive.rb +3 -1
@@ 12,8 12,9 @@ module REXML
     # formatted.  Since this formatter does not alter whitespace nodes, the
     # results of formatting already formatted XML will be odd.
     class Transitive < Default
-      def initialize( indentation=2 )
+      def initialize( indentation=2, ie_hack=false )
         @indentation = indentation
+		@ie_hack = ie_hack
         @level = 0
       end
 

          
@@ 29,6 30,7 @@ module REXML
         output << "\n"
         output << ' '*@level
         if node.children.empty?
+		  output << " " if @ie_hack
           output << "/" 
         else
           output << ">"

          
M test/core_test.rb +6 -0
@@ 1102,6 1102,12 @@ EOL
       assert_equal( names[i], el.xpath )
     } 
   end
+  
+  def test_transitive
+	doc = REXML::Document.new( "<a/>")
+	s = ""
+	doc.write( s, 0, true )
+  end
 
   # This is issue #40
   def test_replace_with