DTDs are equivalent to data, and schemas are equivalent to collections.
XML Schemas are created by a set of pre-defined XML elements and attributes.
DTD does not follow XML syntax, DTD data type is limited, DTD is not extensible, DTD does not support space
Named.
Schema is based on XML syntax, can handle the processing of XML documents, extend the data type, can
With custom data types, schema supports inheritance,
The document structure of the schema.
The DTD and schema function the same, both for XML validation. The schema is more powerful.
Also the schema is a XML,DTD not an XML.
Myschema.xsd
<?xml version= "1.0" encoding= "UTF-8"?>
<xs:schema xmlns:xs= "Http://www.w3.org/2001/XMLSchema"
elementFormDefault = "qualified"
\myschema.xsd ">
< name > I love programming </name >
< author > Mingming </author >
</Books >
All schema documents use schema as their root element.
The elements and data types used to construct the schema come from
The Http://www.w3.org/2001/XMLSchema namespace.
The schema element function contains a schema that has already been defined.
The element element acts as a declaration of elements.
<xs:element name= "Cat" type= "xs:string" >
<xs:complexType>
<xs:sequence minoccur= "0" maxoccurs= "0" >
<xs:element ref= "Cat"/>
</xs:sequence>
</xs:complexType>
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.