Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Base URI interpretation

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: jcowan AT reutershealth.com
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] Base URI interpretation
  • Date: Wed, 31 Mar 2004 17:19:18 -0500

Elliotte Harold scripsit:

> Section 4.2 of the XML Base spec, as revised by errata, says, "2. the
> base URI of the element's parent element within the document entity or
> external entity, if one exists, otherwise"
>
> Does this mean "within the *same* document entity or external entity"?

Yes.

> If so am I correct in assuming that one should never use the base URI of
> an element from a different entity, *including ones set by xml:base
> attributes in a different entity*, to resolve base URIs?

No. Rule 2 simply means that if element A incorporates element B
(having no xml:base attribute of its own) from a different entity, and
B's parent in that entity is C, then C's base URI is preferred to A's.
But if there is no C, or its base URI is not known, then Rule 3 tells
us to use A's base URI for B.

> Still, I wonder if maybe preserving base URIs by inserting xml:base
> attributes on serialization should be the default?

Yes. This comes up during XIncluding, resolving external entities
(reference to an internal entity does not itself affect the base URI),
and when the user sets the base URI programmatically (which is outside
the scope of the Infoset).

--
John Cowan jcowan AT reutershealth.com www.reutershealth.com
www.ccil.org/~cowan
I am he that buries his friends alive and drowns them and draws them
alive again from the water. I came from the end of a bag, but no bag
went over me. I am the friend of bears and the guest of eagles. I am
Ringwinner and Luckwearer; and I am Barrel-rider. --Bilbo to Smaug




Archive powered by MHonArc 2.6.24.

Top of Page