File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Product and Other Certifications and the fly likes what is the differene between the DTD and schema? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Product and Other Certifications
Bookmark "what is the differene between the DTD and schema?" Watch "what is the differene between the DTD and schema?" New topic

what is the differene between the DTD and schema?

Sudhakar Reddy Kurakula
Ranch Hand

Joined: Aug 19, 2006
Posts: 42
Please give me answer very urgent.
vipul patel
Ranch Hand

Joined: Oct 16, 2005
Posts: 146
There are following key differences.

1. DTD allows only to constraint your elements structure and does not validate element contents.
Whereas XML Schema will allow to contraint element structure as well as element content.

2. DTD is not XML where as Schema is XML. so it is convient for XML designer to write schema than DTD as
writing DTD will involve understanding different syntax altogether.

3. The largest addition XML Schemas provide to the functionality of the descriptions is a vastly improved data typing system. XML Schemas provide data-oriented data types in addition to the more document-oriented data types XML 1.0 DTDs support, making XML more suitable for data interchange applications. Built-in datatypes include strings, booleans, and time values, and the XML Schemas draft provides a mechanism for generating additional data types. Using that system, the draft provides support for all of the XML 1.0 data types (NMTOKENS, IDREFS, etc.) as well as data-specific types like decimal, integer, date, and time. Using XML Schemas, developers can build their own libraries of easily interchanged data types and use them inside schemas or across multiple schemas.
Prabhu Venkatachalam
Ranch Hand

Joined: Nov 16, 2005
Posts: 502

For writing DTD, you need to learn the element syntax but for writing XSD you don't. because it is same like XML and it pretty easy to understand than DTD.

Prabhu Venkatachalam<br />SCJP 1.4,SCWCD 1.4<br />
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
Originally posted by Sudhakar Reddy Kurakula:
Please give me answer very urgent.

You can do type checking with xsd , but not with DTD.

Rahul Bhattacharjee
LinkedIn - Blog
I agree. Here's the link:
subject: what is the differene between the DTD and schema?
It's not a secret anymore!