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: "Bradley S. Huffman" <hip AT cs.okstate.edu>
  • To: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Builder argument swap
  • Date: Mon, 22 Mar 2004 11:40:01 -0600

Elliotte Rusty Harold writes:

> >Speaking of tricky things, would there be a reason for an application to
> >set the base uri, as opposed to it only being set in Builder?
>
> It makes sense when the document is provided as a String,
> InputStream, or Reader that does not know its base URI. Less sense
> when the document is provided as a file. However, I can imagine cases
> where the user wants to load a File from a local cache but point the
> base URI at a web server.

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.

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

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.

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

Brad




Archive powered by MHonArc 2.6.24.

Top of Page