Women in Technology

Hear us Roar

  Exploring E4X with Ruby
Subject:   Nice Idea
Date:   2004-09-12 09:13:40
From:   jherr2002
Response to: Nice Idea

Sounds like you need to add the new tree to the root element as opposed to the document. For example:

myDoc.myRoot << myNewTree;

As opposed to:

myDoc << myNewTree

If that doesn't work you can send me (jack_d_herrington@pobox.com) the code and I will take a look at it.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • Nice Idea
    2004-10-15 12:22:16  HotFusionMan [View]

    I was so happy to see the easy-to-use syntax in this article that I turned the inline code into a library file and a Test::Unit test case. In the course of running the tests, I may have uncovered the bug reported here: the readxml method was not using the document's root to create the NodeWrapper, as the xml method was. Once I added ".root" to the end of the argument to NodeWrapper.new, I had no more test failures.