Basic XML knowledge (3)

Source: Internet
Author: User
XML syntax (3)-attributes, declarative symbols, character data, and comments
  • Attribute: Provide additional information about the element.

    • Attribute is part of the element start tag. Eg:

      • <Para keywords = "Napoleon, France, history">
      • ...
      • </Para>
    • Note:
      • Attributes are composed of "name" and "value", separated by "=. Values are enclosed by quotation marks. If they contain double quotation marks, they are enclosed by single quotation marks, and vice versa.
      • A tag can contain multiple attributes: <para topic = "xml" author = "J. Smith" lastrevised = "10/30/2000">
      • Attribute names and values are case sensitive.
      • The attribute names starting with "xml:" are retained.
  • Declaration symbol
    • Symbol is used to define how external binary data will be processed.

        • Eg: <! ENTITY coverphoto SYSTEM "/images/cover. tif" ndata tiff>
          NDATA declares the non-text data format TIFF, but must also specify the application that processes the data format

          • <! Notation tiff system "/programs/show1_.exe">
          • Generally (SYSTEM): <! NOTATION FormatName SYSTEM "AppIdentifier">
          • Or (PUBLIC): <! NOTATION TeX PUBLIC "-// SmithCo // NOTATION TeX HelpFile // EN" "programs \ texdisplay.exe">
            First, use the program corresponding to the Public identifier (URI) "-// SmithCo // NOTATION TeX HelpFile // EN". Otherwise, use "programs \ texdisplay.exe" for processing.
          • In particular, when no information is available and no application is available to process the format, it still needs to be declared in the smallest symbol format:
            <! NOTATION FormatName "">
    • Character data: it does not need to be processed by the XML Parser and is placed in the CDATA tag.
      • <! [CDATA [The character data goes here]>
      • <! [CDATA [
        <Firstname> Alice </firstname>
        <Lastname> Walker </lastname>
        ]>
        The "tag" symbol and content will be ignored. Common usage:

        • Reference XML Code Section
        • Contains all types of script code that may contain XML Reserved Words
  • Note: <! -- ...... -->

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.