[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Unclear point in XML Base


doctype entity xml
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@m... | 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/    |
+----------------------------------+---------------------------------+

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.