DTD vs. XML Schema

Source: Internet
Author: User

DTD vs. XML Schema

XML Schema specifies the XML Schema Definition Language, which provides tools to describe the XML 1.0 document structure and restrict its content, including tools that use XML Namespace. The schema language itself uses XML 1.0 to represent and use namespaces. It restructured the capabilities of the XML 1.0 DTD to a large extent and expands these capabilities to a certain extent. Remember that DTD has many limitations:

□For complex requirements, it is usually difficult to use the content model.
□Namespace is not supported.
□Limited support for modularity and reuse.
□Declaration extension or inheritance is not supported.
□Writing, maintaining, and reading large DTD and defining series related modes are all difficult.
□No embedded and structured self-documentation (only <! -- Comments --> available ).
□Content and attribute declarations cannot rely on attributes or element context (many XML languages use this, but their DTD must "allow too many things ").
□Only one simple identity attribute mechanism can be used (in other words, there is no unique scope ).

However, XML Schema is also insufficient:

□Xml Schema is complicated. programmers who only need to use XML occasionally may think it is too rare.
□Xml Schema cannot request specific root elements (therefore, additional information is required even if the simplest document is verified ).
□When describing mixed content, character data cannot be restricted at all.
□Content and attribute declaration cannot rely on attributes or element context (this is also the main problem of DTD ).
□You cannot leave the Declaration to specify the default value.
□The default value of an element can only be character data (excluding tags ).

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.