• Figure 4.11: Tree model of EntityReference example. ProcessingInstruction.
  • DocumentFragment.
  • Tree Model Example
  • Microsoft Word Applied xml a toolkit for Programmers Wiley doc




    Download 2,96 Mb.
    Pdf ko'rish
    bet100/131
    Sana14.05.2024
    Hajmi2,96 Mb.
    #232039
    1   ...   96   97   98   99   100   101   102   103   ...   131
    Bog'liq
    Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

    EntityReference.
    An EntityReference node (see Figure 4.11) represents a reference to 
    an entity that is declared in a DTD. For the following XML document, an EntityReference 
    node is created to represent “&xml;.” This node is inserted as a child of the root Element 
    node. Figure 4.11 shows how the DOM would expose the following XML document. It 
    could be argued that the two Text nodes that represent Extensible Markup Language are 
    the same node. It doesn’t matter in this diagram, because when you reach a NodeList, it 
    is the Text node that you see in the child list. Also, the Text nodes under 
    EntityReferences are read-only, rendering the argument meaningless, because you can’t 
    change the node.
    ]>
    &xml;
    Figure 4.11:
    Tree model of EntityReference example.
    ProcessingInstruction.
    A ProcessingInstruction node models a processing instruction
    such as . This node is located as a child of the Document node.
    Comment.
    A Comment node represents the comment construct . 
    Comment nodes are inserted in the tree with respect to the XML construct located in 
    within an XML document.
    DocumentFragment.
    The DocumentFragment node is a stripped-down version of the 
    Document node. It’s used as a placeholder when moving nodes around. This node does 
    not have the full facility of the Document node, because it’s just temporary storage for 
    nodes that will be reinserted into the tree.
    Tree Model Example
    The following is a simple example to show the tree representation that would be exposed 
    through the DOM on an actual piece of XML. (See Figure 4.12.)



    - 108 -


    CD Player
    199.95


    Beethoven’s Ninth
    13.95



    Download 2,96 Mb.
    1   ...   96   97   98   99   100   101   102   103   ...   131




    Download 2,96 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    Microsoft Word Applied xml a toolkit for Programmers Wiley doc

    Download 2,96 Mb.
    Pdf ko'rish