W3C home > Mailing lists > Public > www-dom@w3.org > April to June 2008

Regarding Entity Reference Nodes

From: Ashwin <ashwins@huawei.com>
Date: Mon, 23 Jun 2008 12:20:31 +0800
To: www-dom@w3.org
Cc: ranjit@huawei.com
Message-id: <001601c8d4e8$79db1040$7591460a@china.huawei.com>



I had some doubts regarding entity and entity reference nodes with respect
to DOM Level-2 Specification

The spec states that :-


EntityReference objects may be inserted into the structure model when an
entity reference is in the source document, or when the user wishes to
insert an entity reference. Note that character references and references to
predefined entities are considered to be expanded by the HTML or XML
processor so that characters are represented by their Unicode equivalent
rather than by an entity reference. Moreover, the XML processor may
completely expand references to entities while building the structure model,
instead of providing EntityReference objects. If it does provide such
objects, then for a given EntityReference node, it may be that there is no
F2> Entity node representing the referenced entity. If such an
F2> Entity exists, then the subtree of the EntityReference node is in
general a copy of the
F2> Entity node subtree


Suppose I have document like :-

?xml version="1.0"?>

<!DOCTYPE name [

  <!ELEMENT name (#PCDATA)>

   <!ENTITY first "Gita">

   <!ENTITY second "Anjali">

   <!ENTITY third "Mohanty">

  <!--This is a comment-->




My doubt is what the child node for the entity reference &first; will be?

Should it be a text node containing the replacement text "Gita", or is it by
any chance a reference to the entity node first itself?


I would be grateful fro some clarifications


Thanks & Regards




Received on Monday, 23 June 2008 15:20:00 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 20 October 2015 10:46:13 UTC