OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Unclear point in XML Base

[ Lists Home | Date Index | Thread Index ]

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@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/    |
+----------------------------------+---------------------------------+




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS