Write a definition of XML and XML



 What is XML?

  • definition

      1. XML is EXtensible Markup Language word shorthand, Chinese meaning is: Extensible Markup Language.
        a) Scalable : html tags are predefined and can not be arbitrarily defined, we call can not be extended.
               XML tags can be arbitrarily defined, so we called Extensible
        b) mark : We want to operate something, you must first select it, and then the operation.
              Select the one who expresses, what to do, and then let the browser when it is selected and then do the corresponding operations in HTML web writers

           

           c) Language : web browser writers and communication, the two sides need to exchange language
       2. Objective: XML is a format for data exchange, has nothing to do with the programming language.
       3. International standards: it is a standard defined by the organization w3C

  •  The difference between HTML and XML

      1. Objective : HTML is to provide content to the browser how to display, and XML for data exchange
         2. The definition of the label : HTML tags are pre-defined, the same label version is fixed. The XML tags can be arbitrarily defined
         3. syntax : HTML is not rigorous language requirements (browser manufacturers in order to increase the market share of the browser will automatically grammatical
          errors corrected), and our XML language is very strict.

  • XML syntax requires

         1. Each element must have a closing tag, such as <img> tag on the end of wood in html, is not allowed in XML
         2. case sensitive: in html successful signature, uppercase and lowercase attribute names are different wood
         3. There must be a root element
         4. attributes must be quoted: HTML attribute can not add
         5. special character to be escaped
         6. to meet the requirements of the document dtd or xsd


Writing XML

  • Example 1

      

  • Example 2

      

  • Example 3

      

  • Example 4

        

  • Example 5

      This example shows <? Xml must be one, without spaces

        

  • Example 6

      

 

 

 

 

 

 



 

Guess you like

Origin www.cnblogs.com/yuanshuai1026/p/11583968.html