Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Builder argument swap

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: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Builder argument swap
  • Date: Mon, 22 Mar 2004 16:39:32 -0500

At 11:40 AM -0600 3/22/04, Bradley S. Huffman wrote:

What about setBaseURI? If you build a document from a file with Builder,
getBaseURI on any element attached to the document will return the uri
of the file. Remove a element and getBaseURI on that element and any of it's
element children will return null.

We've discussed this in the past, and the result was the current behavior. However, I could be convinced that elements should retain their base URI on being detached from the parent. Right now that isn't obviously right though.

Add the removed element to another document with a base attribute somewhere
up the parent chain and getBaseURI will return non-null.

More specifically it will return the base URI in scope in that new document. I think this is what most users will expect; ie.e. it follows the principle of least surprise; but I'm not absolutely convinced here.

However if you build the document by hand and use setBaseURI on all elements,
then getBaseURI will always return the base uri explicitly set, and it doesn't
matter how many times a element is removed and re-added to a element in another
document.

More likely would be setting the base URI when the element is detached.

From reading the XML Base spec., this doesn't make sense, and you have to
go to the Infoset to understand why the above situation occurs. Which makes
me wonder if setBaseURI should be public or even exist at all.

It's necessary for XInclude.

--

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