W3C home > Mailing lists > Public > xml-editor@w3.org > July to September 2005

RE: external entities

From: Junfeng Dong <junfengd@microsoft.com>
Date: Thu, 7 Jul 2005 12:43:58 -0700
Message-ID: <5D4C188603359E4DAD08F6ACF5FDA3A103444229@RED-MSG-52.redmond.corp.microsoft.com>
To: "Eve L. Maler" <Eve.Maler@Sun.COM>
Cc: <xml-editor@w3.org>

Hi Eve,

Thanks for your reply. Here is another question about external entities.
An xml document is given below:

<!DOCTYPE Root [
	<!ENTITY % PE SYSTEM "pent.ent">
<Root att="&ext;" />

The content of file pent.ent is:

<!ENTITY ext "blah">

By definition, PE is an external parameter entity. How about entity ext?
>From your last message, it should be an internal ext, right?


-----Original Message-----
From: Eve L. Maler [mailto:Eve.Maler@Sun.COM] 
Sent: Thursday, July 07, 2005 7:04 AM
To: Junfeng Dong
Cc: xml-editor@w3.org
Subject: Re: external entities

ext is an internal entity that happens to be defined in an external 
subset.  This is, in fact, the typical case for internal entity 
definitions since internal subsets are relatively rare in the wild. 
   (See, for example, the DocBook DTD, which provides a 
"dbgenent.mod" external entity as a placeholder precisely for 
containing internal entities: 
http://www.oasis-open.org/docbook/xml/5.0a1/)  Just because your 
internal entity is called "ext" doesn't make it external in any way.

Hope this helps,


Junfeng Dong wrote:
> Dear Sir or Madam,
> I have a question for the definition of external entities. Suppose
> is an xml document given as follow:
> <!DOCTYPE root SYSTEM "ext.dtd" [
> ]>
> <root a="&ext;"/>
> The content of file ext.dtd is:
> <!ELEMENT root ANY>
> <!ENTITY ext "blah">
> Is entity ext counted as an internal entity or an external entity? In 
> xml specification, "The document type declaration can point to an 
> external subset (a special kind of external entity 
> <http://www.xml.com/axml/target.html#dt-extent#dt-extent>) containing 
> markup declarations," In my understanding, since ext.dtd is an
> subset and a special kind of external entity, then ext is by default,
> external entity. However, by the definition of internal entity ("If
> entity definition is an |EntityValue 
> <http://www.xml.com/axml/target.html#NT-EntityValue#NT-EntityValue>|, 
> the defined entity is called an *internal entity*. There is no
> physical storage object, and the content of the entity is given in the

> declaration."), entity ext is an internal entity.
> I am confused here. Since if ext is an external entity, then the 
> document isn't well-formed.
> Thanks in advance.
> Junfeng

Eve Maler                                         +1 425 947 4522
Technology Director                           eve.maler @ sun.com
CTO Business Alliances group                Sun Microsystems, Inc.
Received on Thursday, 7 July 2005 19:44:09 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:37:46 UTC