XML development basics-XML verification code sharing

Source: Internet
Author: User
Tags xml attribute
XML with correct syntax is called "well-formed" XML. The XML verified by a DTD is a "legal" XML. A well-formed XML document with a & quot; well-formed & quot; has the correct syntax. A well-formed & quot; XML document follows the XML syntax rules described in the previous chapters: XML with the correct syntax is called "well-formed" XML.

The XML verified by a DTD is a "legal" XML.

Well-formed XML documents

A "well-formed" XML document has the correct syntax.

A "well-formed" XML document follows the XML syntax rules described in the previous chapters:

XML documents must have root elements

The XML document must have a close tag.

XML tags are case sensitive.

XML elements must be correctly nested

The XML attribute must be enclosed in quotation marks.

 
 
  
   George
  
  
   John
  
  
   Reminder
  Don't forget the meeting this weekend!
 

Verify the XML document

A valid XML document is a "well-formed" XML document, which also complies with the syntax rules of Document Type Definition (DTD:

 
 
  
   George
  
  
   John
  
  
   Reminder
  Don't forget the meeting this weekend!
 

In the preceding example, the DOCTYPE declaration references the external DTD file. The following section shows the content of this file.

XML DTD

A dtd defines the structure of an XML document. It uses a series of legal elements to define the document structure:

 
 
 
 ]>

XML Schema

W3C supports an XML-based DTD replacement named XMLSchema:

 
  
   
    
    
    
    
   
  
 

The above is the details shared by the XML verification code. 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.