Advertisements

Brad <> wrote:
> When I use the IRB and do:
> require "rexml/document"
> include REXML
> doc = Document.new File.new("mydoc.xml")
>
> I get an error:
> <UNDEFINED> ... </>
>
> I copied the source file right from the website and created an XML
> document called 'mydoc.xml'
>
> Why is it failing?

Advertisements

On 19.09.2008 20:33, Brad wrote:
> I'm trying to follow this tutorial: http://www.germane-software.com/software/rexml/docs/tutorial.html
>
> When I use the IRB and do:
> require "rexml/document"
> include REXML
> doc = Document.new File.new("mydoc.xml")
>
> I get an error:
> <UNDEFINED> ... </>
>
> I copied the source file right from the website and created an XML
> document called 'mydoc.xml'
>
> Why is it failing?

As Matt said, it isn't. But you should make it a habit to properly
close file handles; use any of these:

Share This Page

Welcome to The Coding Forums!

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free. You'll be able to ask questions about coding or chat with the community and help others.
Sign up now!