From: Matt Gushee Date: 2002-10-08T01:52:32+09:00 Subject: Re: REXML & Root Node On Tue, Oct 08, 2002 at 01:38:05AM +0900, Hammond, Tony (ELSLON) wrote: > > I'm getting errors from REXML with leading whitespace when I have an XML > Declaration - see below. (Problem doesn't show up when I omit the > Declaration.) Any ideas? Could you be a little more precise about what you mean by 'leading whitespace'? If it's whitespace before the XML declaration, you should be getting an error ... although I don't get an error either with or without the whitespace. What version of REXML are you using (I'm using 2.5.1)? > Also I'm not quite sure why the document element is returned by the root > method. Surely the root node is the outermost container which wraps document > element, PI's, XML Declaration, whitespace, etc.? Sure ... but the root method returns the root *element*, which is another name for the document element. I guess whether that's intuitive or not is in the eye of the beholder (it is for me), but since, for all practical purposes, the root *node* is equivalent to the document object, why would you need a method to get it anyway? -- Matt Gushee Englewood, Colorado, USA mgushee@havenrock.com http://www.havenrock.com/