# REXML (1.8.6 p111) Document.write fails - "undefined local"

**URL:** <https://www.ruby-forum.com/t/rexml-1-8-6-p111-document-write-fails-undefined-local/127193>\
**Category:** Ruby\
**Created:** [January 26, 2008, 12:27am UTC](https://www.ruby-forum.com/t/rexml-1-8-6-p111-document-write-fails-undefined-local/127193 "2008-01-26T00:27:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [January 26, 2008, 12:27am UTC](https://www.ruby-forum.com/t/rexml-1-8-6-p111-document-write-fails-undefined-local/127193/1 "2008-01-26T00:27:28Z")

</div>

All,

Windows One-Click installer Ruby 1.8.6 patchlevel 111.

I have code that uses REXML to emit an XML document and when I run it on  
1.8.6 (upgraded) from 1.8.4, I see the error “undefined local variable”.  
Sure enough,  
if I look in the Document.write method, I see a variable “transitive”  
that should be named “trans”.

def write( output=$stdout, indent=-1, trans=false, ie\_hack=false )  
if xml\_decl.encoding != “UTF-8” && !output.kind\_of?(Output)  
output = Output.new( output, xml\_decl.encoding )  
end  
formatter = if indent \> -1  
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

This is also referenced in this thread from last October:  
[http://www.ruby-forum.com/topic/128842](http://www.ruby-forum.com/topic/128842)

Is there an updated set of REXML standard library files that I can  
download. I assume that this is fixed already in the standard lib  
trunk.

What is the best way to resolve this?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [January 30, 2008, 6:58am UTC](https://www.ruby-forum.com/t/rexml-1-8-6-p111-document-write-fails-undefined-local/127193/2 "2008-01-30T06:58:30Z")

</div>

Current solution is to simply fix the name of the variable. Whatever  
problem this was causing resolved itself.

Wes
