From: Ian Macdonald Date: 2002-09-12T11:04:03+09:00 Subject: Re: using REXML for XML document creation On Thu 12 Sep 2002 at 10:23:12 +0900, David Naseby wrote: > Try : > doc = REXML::Document.new > elt = doc.add_element("ADDRESSBOOK") > parent = elt.add_element("CONTACTS") > aContact = parent.add_element("CONTACT") > aContact.add_attribute("FileAs","Macdonald, Ian") > aContact = parent.add_element("CONTACT") > aContact.add_attribute("FileAs","Contact, Another") > aContact = parent.add_element("CONTACT") > aContact.add_attribute("FileAs","Contact, YetAnother") > > Keep the reference to the parent element, and keep adding to it. Thanks. I'm not finding this module intuitive, which is in no way intended as a criticism of REXML. Things which are essentially very easy aren't coded in a way that is obvious to me. Ian -- Ian Macdonald | There's something different about us -- ian@caliban.org | different from people of Europe, Africa, | Asia ... a deep and abiding belief in the | Easter Bunny. -- G. Gordon Liddy |