From: Matt Gushee Date: 2002-09-12T10:36:07+09:00 Subject: Re: using REXML for XML document creation On Thu, Sep 12, 2002 at 10:19:14AM +0900, Ian Macdonald wrote: > > > > doc = REXML::Document.new > > elt = doc.add_element("ADDRESSBOOK") > > elt = elt.add_element("CONTACTS") > > elt = elt.add_element("CONTACT") > > elt.add_attribute("FileAs","Macdonald, Ian") > > Actually, how do I add the next element? If I just use > add_element again, I get the next nested inside the first > one. Well, it should be obvious that I used a bare minimum of variable names for the sake of a minimal example. Surely you can figure out how to use additional variable names, or a stack, or some other common device to achieve the effect you want. If that's not clear yet, a little experimentation should make it so. -- Matt Gushee Englewood, Colorado, USA mgushee@havenrock.com http://www.havenrock.com/