XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] A problem with Base URI and nested XIncludes

On Wed, 2019-08-14 at 12:37 +0100, Michael Kay wrote:
> 
> The spec for xml:base says (ยง4.3) The base URI for a URI reference
> appearing in an xml:base attribute is the base URI of the parent
> element of the element bearing the xml:base attribute, if one exists
> within the document entity or external entity, otherwise the base URI
> of the document entity or external entity containing the element.

The xml:base spec should have been modified to take XInclude into
account, but i don't think any of us thought of it. Instead, the
XInclude spec includes text about base URI fixup - see below.

In general of course, the goal is that the xml:base property of any
element always tells you where that element came from. The underlying
assumption is that the only boundary points at which the base property
changes are the "edges" of expanded file (external parsed) entities and
the outermost document itself, but XInclude breaks that assumption.

What makes most sense to me is to treat your example as,
<!ENTITY c1 SYSTEM "subfolder/child.xml">
<!ENTITY c2 SYSTEM "otherchild.xml">

with subfolder/child.xml looking like:
<child>&c2;</child>

So, the base attrbute is recording for applications the history of how
the document was constructed.

> Would anyone argue that the Xerces output is correct?

Yes, because XInclude includes a section, Base URI Fixup.

See
https://www.w3.org/TR/xinclude/#base
and more recent prose at
https://www.w3.org/TR/xinclude-11/#base
(but the XML Core Working Group was closed before this could become a
Recommendation).

Liam

-- 
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Web slave for vintage clipart http://www.fromoldbooks.org/



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS