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 21:30:55 -0500

At 8:16 PM -0600 3/22/04, Bradley S. Huffman wrote:

I understand what happens. This is not an unconscious decision. John Cowan, Laurent Bihanic and I talked this out at great length on the list about a year and a half ago. See https://lists.ibiblio.org/sympa/arc/xom-interest/2002-September/000110.html

Which just hits me a violation of the principle of least surprise. I just
cann't help but think if using StringReader is inobvious to a good many
users then this will really confuse them.

We weren't convinced that this was an ideal solution. It's definitely a borderline case. However, we came down on the side of the current behavior. Our judgement was that users would not expect a node moved from one document to another to have a different base URI than its containing document unless a base URI had been explicitly set.

If you can tip the scales in the other direction and convince me base URIs should survive detachment, that decision may change. As I said we weren't confident in our decision. It was more like 55/45. Perhaps you can think of something we didn't then. A really good use case would be helpful. Perhaps XInclude could provide one. Currently XInclude resolution has to explicitly set all the base URIs on the resolved documents. In your approach this would be automatic.

However, do be sure to also consider the case of nodes with no explicit base URI created in one document and then moved to a different document. I think this is what finally convinced me not to preseve base URIs in this situation.

However, I not sure what should be done. Should Builder call setBaseURI for
every element (right now it only calls setBaseURI on the document node)?

I think the more likely approach would be to set the base URI only when detaching rather than when first creating the element.
--

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