What is the difference between Schema and DTD? - XML

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.
How do you parse/validate the XML document? - XML
Parsing the XML document is the only way to validate the XML file.......
What is XML template? - XML
A transformation rule describes a style sheet. Transmission rule is a combination of a pattern and a template.......
What is Xpath? - XML
XPath specifies the path in the XML document which has hierarchical elements......
Post your comment