Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] Unclear point in XML Base

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: www-xml-linking-comments AT w3.org
  • Cc: xml-dev AT lists.xml.org, xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] Unclear point in XML Base
  • Date: Fri, 27 Sep 2002 08:44:09 -0400

I have a technical question about the interpretation of the XML Base specification regarding how xml:base attributes interact with external entities. Does the xml:base attribute have scope beyond the entity in which it appears? Consider the following document:

<!DOCTYPE root [
<!ENTITY external SYSTEM "http://www.example.com/example.xml";>
]>
<system xml:base="http://www.cafeaulait.org/";>
&external;
</system>

Let us suppose that when the entity is resolved we have the following
document:


<system xml:base="http://www.cafeaulait.org/";>
<para>This came from the external entity</para>
</system>

What is the base URI of the para element? Is it "http://www.example.com/example.xml or http://www.cafeaulait.org/?

The spec is unclear. It states

The base URI of an element is:

1. the base URI specified by an xml:base attribute on the element, if one exists, otherwise

2. the base URI of the element's parent element within the document or external entity, if one exists, otherwise

3. the base URI of the document entity or external entity containing the element.


Clearly, point 2 applies. Unfortunately the English is unclear. Does it mean:

A. the base URI of the element's parent element within the *same* entity, whether that entity is a document entity or external entity

B. the base URI of the element's parent element whether the element comes from the document entity or an external entity

C. Something else?

Clarification would be appreciated. I'm trying to figure out what base URI determination algorithm is appropriate for XOM, and this point has a significant effect on that. I note that the latest draft of XInclude requires processors to add xml:base attributes to the included infoset so there's no possible confusion there. However, this is not an option for external entity resolution.
--

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo AT metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
| XML in a Nutshell, 2nd Edition (O'Reilly, 2002) |
| http://www.cafeconleche.org/books/xian2/ |
| http://www.amazon.com/exec/obidos/ISBN%3D0596002920/cafeaulaitA/ |
+----------------------------------+---------------------------------+
| Read Cafe au Lait for Java News: http://www.cafeaulait.org/ |
| Read Cafe con Leche for XML News: http://www.cafeconleche.org/ |
+----------------------------------+---------------------------------+




Archive powered by MHonArc 2.6.24.

Top of Page