[jdom-interest] isRootElement issue
kesavk at voquette.com
Mon Oct 23 13:35:02 PDT 2000
What is actual meaning of isRootElement? is it just to verify whether the
element is attached to document or does it have any parent or not?
I have test case like this.
I created an Element like
Element root = new Element("Root");
Element child = new Element("Child");
Since root and child doesn't have document associate with them both
child.isRootElement() and root.isRootElement() return false.
Ideally I feel root.isRootElement should return true sice it has a child.
I propose that we should check for getParent == null for determinig the root
650 356 3740
mailto:kesavk at voquette.com
From: Jason Hunter [mailto:jhunter at collab.net]
Sent: Monday, October 23, 2000 1:20 PM
To: Kesav Kumar
Cc: 'jdom-interest at jdom.org'
Subject: Re: [jdom-interest] isRootElement issue
isRootElement returns true only if "document != null". In other words,
only if it directly holds a reference to its document which only the
root will do. What's wrong with that? If you have an actual test case
that fails, please send it, making sure of course to test against the
latest first. :-)
Kesav Kumar wrote:
> The method isRootElement() returns true/false on the basis of document.
> it right way of doing? I think we need to decide whether the element is
> root based on whether the element has any parent. The reason is If i
> a new Element the document is null, after I added child to the new Element
> and query on the child isRootElement it gives true since there is no
> document. I feel we should check whether getParent() is null or not.
> Any suggestions--
> Kesav Kumar
> Software Engineer
> Voquette, Inc.
> 650 356 3740
> mailto:kesavk at voquette.com
> To control your jdom-interest membership:
More information about the jdom-interest