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

RE: external entities

From: Xu Han-a21787 <hanxu@motorola.com>
Date: Thu, 7 Jul 2005 13:41:13 +0800
Message-ID: <FFC0F71CF81AD61193F700B0D078A70D07618068@ZCH45EXM01.corp.mot.com>
To: Junfeng Dong <junfengd@microsoft.com>, xml-editor@w3.org

Hi, Junfeng,

The ext is definitely an external entity. 

Clearly the file ext.dtd is not an XML document since it does not match the following production:

[1]    document    ::=    prolog element Misc* 

So the statement 

"If the entity definition is an EntityValue , the defined entity is called an internal entity. There is no separate physical storage object, and the content of the entity is given in the declaration."

does not apply to the ext declared in ext.dtd.

Hope this helps.

Best Regards,
Han Xu



________________________________

From: xml-editor-request@w3.org [mailto:xml-editor-request@w3.org] On Behalf Of Junfeng Dong
Sent: Thursday, July 07, 2005 1:20 PM
To: xml-editor@w3.org
Subject: external entities



Dear Sir or Madam,



I have a question for the definition of external entities. Suppose there 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>

<!ATTLIST root a NMTOKEN #IMPLIED>

<!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 external subset and a special kind of external entity, then ext is by default, an external entity. However, by the definition of internal entity ("If the 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 separate 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
Received on Thursday, 7 July 2005 10:09:00 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 07:15:56 UTC