Understand several xml file formats

Source: Internet
Author: User
PHP100 is the first professional website in China to share PHP resources. It also provides a PHP Chinese communication community. For PHP study researchers: The latest PHP information, original content, open source code and PHP video tutorials and other related content. [Introduction] 1. First, let's briefly introduce XML, which is a text-based markup line Language. similar to html, xml can easily store data. 2. several formats of XML files: Format 1: view an xml cd Directory [html] view plaincopy

1. let's briefly introduce XML. xml is a text-based markup line language, which is similar to html and can store data conveniently.

2. XML file formats:

Format 1: view the CD directory of an XML file

[Html] view plaincopy

   
       
            
   Empire Burlesque          Bob Dylan          
   
    USA
             
   
    Columbia
             
   
    10.90
             
   
    1985
         
        
            
   Hide your heart          Bonnie Tyler          
   
    UK
             
   
    CBS Records
             
   
    9.90
             
   
    1988
         
    
 

Format 2: view the school grade directory of an XML file

[Html] view plaincopy

   
       
        
        
        
        
    
 

3. resolution:

1. xml can only have one root-level element, but cannot have multiple root-level elements. for example, add another root-level element in format 2. And an error is reported.

2. xml elements can be nested cyclically. parent elements include child-level elements, and child-level elements can contain their own child-level elements,

For example, format 1: root-level elements Contains child-level elements , And Child-level elements can contain multiple child-level elements.

3. two forms of elements:

Form 1 <节点名称> [Value] For example:Article title

Form 2 <节点名称 属性1="[值]" 属性2="[值]" 属性3="[值]" ... 属性n="[值]/">

For example:

The above is the details of several xml file formats. For more information, see other related articles in the first PHP community!

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.