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 little experiment to compare external entities and XInclude

At 2010-08-16 10:33 -0400, Costello, Roger L. wrote:
>I did a little experiment.
>
>I dragged and dropped this into Internet Explorer:
>
>-----------------------------------------------
><?xml version="1.0"?>
><!DOCTYPE BookStore [
>     <!ENTITY Siddhartha SYSTEM "Siddhartha.xml">
>]>
><BookStore>
>
>     &Siddhartha;
>
></BookStore>
>-----------------------------------------------
>
>The browser resolved the external entity reference and this is what I saw:
>
><?xml version="1.0" ?>
><!DOCTYPE BookStore (View Source for full doctype...)>
><BookStore>
>     <Book>
>        <Title>Siddhartha</Title>
>        <Author>Hermann Hess</Author>
>        <Date>1951</Date>
>        <ISBN>0-553-20884-5</ISBN>
>        <Publisher>Bantam Books</Publisher>
>     </Book>
></BookStore>
>
>
>Next, I dragged and dropped this into Internet Explorer:
>
>-----------------------------------------------
><?xml version="1.0"?>
><BookStore xmlns:xi="http://www.w3.org/2001/XInclude";>
>
>     <xi:include href="Siddhartha.xml" parse="xml">
>         <xi:fallback />
>     </xi:include>
>
></BookStore>
>-----------------------------------------------
>
>The browser did NOT resolve the XInclude reference. I saw no change.

Doesn't surprise me.

>I repeated the experiment with the Firefox browser and it exhibited 
>the same behavior as Internet Explorer.
>
>QUESTIONS
>
>1. What should I conclude from this little experiment? Should I 
>conclude that the browsers support external entities but do not 
>support XInclude?

I would.  XInclude is not part of the XML specification ... it is a 
separate specification.

>2. <xi:include> elements are resolved by the XML parser, correct?

I wouldn't think so.  An XML processor is defined by the XML 
specification and XInclude is a supplemental specification that isn't 
part of the definition of XML.  I would expect an XInclude processor 
(if such exist ... I haven't had to look for one) would incorporate 
an XML processor and would give you what you want.

But if something claims it supports XML I would not therefore 
conclude that it supports XInclude.

>By "resolve" I mean that the <xi:include> element is replaced by the 
>contents of the file it references.

I thought XInclude processing was ambiguous:  for example, does one 
validate an instance with XInclude before or after the element is 
replaced with its contents?

>3. The XML parsers in IE and Firefox do not support XInclude, correct?

I doubt it ... they only claim to support XML.

>4. The XML parser in IE is MSXML, correct?

The XML processor in IE works very well.  The only thing I don't like 
about it is the way it builds the node tree for XSLT processing by 
implicitly tossing white-space-only text nodes that I may want to 
keep.  I very much like the way it processes declaration subsets.

>5. What is the XML parser in Firefox?

I don't know, but I have experienced it choking on some declaration 
subsets in ways that don't choke IE.

>6. What XML parsers support XInclude?

I would rather ask which XInclude processors are out there ... 
XInclude isn't part of XML.

BTW, regarding terminology from the introduction of XML, section 1.0:

    http://www.w3.org/TR/2008/REC-xml-20081126/#sec-intro
    [Definition: A software module called an XML processor is
     used to read XML documents and provide access to their content
     and structure.]

I see that as restricting it to the XML specification, not including 
things like XInclude.

 From XInclude:

    http://www.w3.org/TR/xinclude/#intro
    This specification introduces a generic mechanism for merging
    XML documents (as represented by their information sets) for
    use by applications that need such a facility.

Which implies that you would need an XInclude processor for merging, 
not that XInclude somehow becomes part of what an XML Processor is 
obliged to support.

I hope this helps.

. . . . . . . . . Ken

--
XSLT/XQuery training:   after http://XMLPrague.cz 2011-03-28/04-01
Vote for your XML training:   http://www.CraneSoftwrights.com/x/i/
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/x/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal



[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