Difference between DTD and schema & common methods for parsing XML files

Source: Internet
Author: User
Schema and DTD 
Are used to define the use specification of XML tags in various files.
Schema is a standard XML file, while DTD uses its own special syntax. Therefore, you only need to know the XML syntax rules to write the schema, and you do not need to learn other syntax rules. you can use the same processor to interpret it,
Schema uses the namespace to associate special nodes in the file with the schema description. an XML file can have multiple corresponding schemas. If it is a DTD, an XML file can have only one corresponding DTD file.
The schema content model is open and can be expanded at will, while the DTD cannot interpret the expanded content. the DTD can only define the file type as a string, while the schema can define the file type as an integer, floating point number, String, Boolean value, or other data types without redefinition.
The obvious advantage of Schema over DTD is that the schema file itself is also an XML file, rather than using a special format like DTD, thus facilitating users and designers. because they can use the same tools to process and develop schema and other XML data, rather than using specialized development or processing tools.

XML File Parsing Method: Sax parsing and Dom Parsing
Sax parsing: uses the file stream to read and parse a row. After parsing, You can recycle it. Memory is saved, but the speed is slow.
Dom parsing: Read data into the memory at a time and analyze and explain its structure. The speed is improved, but the memory usage is very high.

Difference between DTD and schema & common methods for parsing XML files

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.