What is the difference between Schema and DTD?DTD:
- It is a set of markup declarations which define a document type for the markup language, such as SGML, XML, HTML. - DTD stands for Document Type Definition.
It supports two types of data:
1. PCDATA (Parsed Character Data): XML parsers normally parse all the text in an XML document. 2. CDATA (Character Data): It is used about text data that should not be parsed by the XML parser.
- It defines the elements, attributes, ordering and nesting elements.
- DTD lacks strong typing capabilities and it has no way of validating the content to data types.
- It does not define the order for child elements.
- It does not support datatypes.
Schema:
- It is the structure of an XML document.
- It supports numeric, Boolean and String data types.
- It is suitable for applications that developed in a programming language.
- Schema supports custom data types.
- It supports encapsulation and inheritance concepts.
- Schema supports for WEB services, XSLT.
- It defines order for child elements.
|