xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Preserving base URIs on detachment
- From: Grant Wood <grant AT nanode.org>
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Preserving base URIs on detachment
- Date: Fri, 26 Mar 2004 13:44:38 -0600
On Mar 25, 2004, at 10:47 PM, Elliotte Rusty Harold wrote:
Document doc = builder.build("http://www.example.com/");
Element child = new Element("child");
// child.getBaseURI() returns null
doc.getRootElement().appendChild(child);
// child.getBaseURI() returns http://www.example.com
child.detach()
What should child.getBaseURI() return now? null or http://www.example.com?
--
In the case where (continuing from your example):
Document newdoc = new Document(child);
Shouldn't:
newdoc.getBaseURI().equals( newdoc.getRootElement().getBaseURI() );
be true?
If it is true, then either:
a) The Document(Element root) constructor inherits BaseURI from root
-or-
b) The Document(Element root) constructor resets root's BaseURI to some default
What is the current behavior for this constructor with regards to BaseURIs? a) seems wrong to me, but since I can think of no other reasons for preserving the BaseURI of a detached element, I think null is the appropriate value to return.
Am I missing something? Is there a specific use case you're thinking of where preserving the BaseURI makes sense?
Grant Wood
Nanode LLC
grant at nanode.org
www.nanode.org
-
Re: [XOM-interest] Preserving base URIs on detachment,
Grant Wood, 03/26/2004
- <Possible follow-up(s)>
-
Re: [XOM-interest] Preserving base URIs on detachment,
Elliotte Rusty Harold, 03/26/2004
-
Re: [XOM-interest] Preserving base URIs on detachment,
jcowan, 03/26/2004
-
Re: [XOM-interest] Preserving base URIs on detachment,
Bradley S. Huffman, 03/26/2004
- Re: [XOM-interest] Preserving base URIs on detachment, Elliotte Rusty Harold, 03/26/2004
- Re: [XOM-interest] Preserving base URIs on detachment, Elliotte Rusty Harold, 03/26/2004
-
Re: [XOM-interest] Preserving base URIs on detachment,
Bradley S. Huffman, 03/26/2004
-
Re: [XOM-interest] Preserving base URIs on detachment,
jcowan, 03/26/2004
Archive powered by MHonArc 2.6.24.