• Parameter Entities. Entities that are used only inside the DTD itself (sort of shorthand for programming ease). Their general form is: < !ENTITY %
  • Internal General Entity Declaration
  • __NDS_"Next_Day_Service">_<_!ENTITY">!ELEMENT mail (letter)+> SDS "Same Day Service"> NDS "Next Day Service"> < !ENTITY
  • Microsoft Word Applied xml a toolkit for Programmers Wiley doc




    Download 2,96 Mb.
    Pdf ko'rish
    bet85/131
    Sana14.05.2024
    Hajmi2,96 Mb.
    #232039
    1   ...   81   82   83   84   85   86   87   88   ...   131
    Bog'liq
    Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

     
    Entity Declarations
    Entities become more and more important as your applications grow more complex. As 
    we mentioned before, entities are essentially objects that you can point to in your XML 
    document using an entity reference. The actual declaration of the entity is made in the 
    DTD.
    Entities have their own types as well. While we talked briefly about internal and external 
    entities in the entity reference section, we need to mention that both of these can 
    furthermore be subsets of two types of entities:
    Parameter Entities.
    Entities that are used only inside the DTD itself (sort of shorthand 
    for programming ease). Their general form is:
    <
    !ENTITY % 
    entity_name 
    "entity_type"
    >
    General Entities.
    Entities that are used in the XML document itself (that is, under the 
    root element). Their general form is:
    <
    !ENTITY 
    entity_name 
    "entity"
    >
    Realistically, you most likely will be dealing with external entities of the general form. 
    However, in the interest of completion, we’ve described each type.
    Internal General Entity Declaration
    As we mentioned before, a general entity is one that is used in the XML document itself 
    as opposed to being referenced internally in the DTD. One common use of internal 
    general entities is creating a shortcut to typing long words/acronyms. Here’s an example 
    (Note: this is a complete XML document with an internal DTD; keywords are in boldface):
    <
    !ELEMENT 
    mail (letter)+>
    <
    !ENTITY
    SDS "Same Day Service">
    <
    !ENITITY
    NDS "Next Day Service">
    <
    !ENTITY
    Alex "Alex Ceponkus, Canada">
    <
    !ENTITY
    Faraz "Faraz Hoodbhoy, USA">
    <
    !ELEMENT
    letter (to, from, content+)+>
    <

    Download 2,96 Mb.
    1   ...   81   82   83   84   85   86   87   88   ...   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