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

Re: A little experiment to compare external entities and XIncl

  • From: "G. Ken Holman" <gkholman@CraneSoftwrights.com>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Mon, 16 Aug 2010 10:51:10 -0400

Re:  A little experiment to compare external entities and XIncl
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]


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.