• Figure 1.8: How a parser interprets XML. What Does “Well Formed” Mean What Are the Details I Need To Know about Writing XML Syntax
  • 110 Main Street
  • What If I Don’t Want the Data Validated?




    Download 2,96 Mb.
    Pdf ko'rish
    bet22/131
    Sana14.05.2024
    Hajmi2,96 Mb.
    #232039
    1   ...   18   19   20   21   22   23   24   25   ...   131
    Bog'liq
    Ceponkus, Hoodbhoy - Applied XML - Toolkit for Programmers

    What If I Don’t Want the Data Validated?
    If you don’t want your XML data validated, don’t link it to a DTD or schema. Provided the 
    XML document is 
    well formed
    , you won’t have any problems. The diagram in Figure 1.8 
    shows the general scheme of how a parser interprets XML.
    Figure 1.8:
    How a parser interprets XML.
    What Does “Well Formed” Mean? What Are the Details I Need To Know about 
    Writing XML Syntax?
    Well formed
    refers to properly structured markup syntax. Most HTML parsers (yes, 
    browsers have HTML parsers for interpreting HTML) are kind to a fault in terms of 
    tolerating poorly formatted markup syntax (for example, unclosed tags or tags nested out 
    of sequence). The powers that be have decided that XML is not going to be that forgiving, 
    which is very important because it forces authors to structure their information correctly. 
    Recall the blueprint analogy we used earlier. Imagine your blueprint didn’t contain a pillar 
    where it was needed—the whole building could collapse. Well formed XML documents 
    are documents that are structurally correct. Using the same analogy, a valid XML 
    document is a blueprint of a building that is structurally correct and passes all 


    - 20 -
    government regulations.
    When you create XML documents, you have to be very particular about closing all tags, 
    nesting them properly, and using the right syntax. Also, the W3C recommends 
    (recommendations by the W3C can be considered specifications) XML parsers to be 
    case sensitive; thus, the following code clip would not be acceptable:

    110 Main Street

    However, each of the following examples would be acceptable:
    110 Main Street

    110 Main Street

    110 Main Street

    Each of these three samples would be treated as separate entities altogether by an XML 
    parser. 
    Chapter 3
    goes into more details about these issues.

    Download 2,96 Mb.
    1   ...   18   19   20   21   22   23   24   25   ...   131




    Download 2,96 Mb.
    Pdf ko'rish

    Bosh sahifa
    Aloqalar

        Bosh sahifa



    What If I Don’t Want the Data Validated?

    Download 2,96 Mb.
    Pdf ko'rish