• _line_to:_<_!ENTITY_%">!ENTITY % code_format "CDATA"> line to: < !ENTITY %
  • _<_!ENTITY">!DOCTYPE proposal [ executive_summary SYSTEM "executive_summary.xml"> < !ENTITY
  • !ENTITY % code_format " CDATA




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

    !ENTITY %
    code_format "
    CDATA
    ">
    <
    !ENTITY %
    default_value "
    #REQUIRED
    ">
    <
    !ELEMENT 
    cars (car)+>
    <
    !ELEMENT 
    car (
    #PCDATA
    )>
    <
    !ATTLIST 
    car product_code 
    %
    code_format 
    %
    default_value
    delivery_code 
    %
    code_format 
    %
    default_value 
    distributor_code 
    %
    code_format 
    %
    default_value>
    ]>

    distributor

    code ="J3 4212">
    Model 2100ZX3


    To force all the attribute values to have values without white space (that is, NMTOKEN), 
    you’d simply change the
    <
    !ENTITY % 
    code_format "CDATA">
    line to:
    <
    !ENTITY % 
    code_format "NMTOKEN">
    You could do a similar change with the %default_value line to change the default value of 
    the attributes.
    External General Entity Declaration
    General External entities declarations are made when you want to declare the existence 
    of an external object (e.g., a picture or another XML document) as an entity in your 
    document.
    Let’s say we’ve got a proposal document that consists of an executive summary, a 
    discussion section, and a conclusion section. Each of these has been prepared and 
    stored as external documents. In that case, our external entity declarations could look like 
    this:
    <
    !DOCTYPE 
    proposal [
    <
    !ENTITY 
    executive_summary 
    SYSTEM
    "executive_summary.xml">
    <
    !ENTITY
    discussion 
    SYSTEM
    "discussion.xml">
    <
    !ENTITY
    conclusion 

    Download 2,96 Mb.
    1   ...   83   84   85   86   87   88   89   90   ...   131




    Download 2,96 Mb.
    Pdf ko'rish