Regarding Entity Reference Nodes

 

Hi,

 

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
<http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-527DCF
F2> Entity node representing the referenced entity. If such an
<http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-527DCF
F2> Entity exists, then the subtree of the EntityReference node is in
general a copy of the
<http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-527DCF
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-->

  ]>

<name>&first;&second;&third;</name>

 

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

Ashwin

 

 

 

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