Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Preserving base URIs on detachment

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Preserving base URIs on detachment
  • Date: Thu, 25 Mar 2004 23:47:11 -0500

There are basically two approaches to this, and they are distinguished thusly:

Should an element created in memory (i.e. not parsed) retain the base URI of its parent when detached?

For instance, suppose we parse a document at http://www.example.com/ to build a Document object. All the elements in this document initially have a base URL of http://www.exmaple.com/. Now we do this:

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?
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page