|
[XML-DEV Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
RE: What is the difference between XSD and DTD
- To: "'Saha Rabindra N'" <saha.rn@m...>,<xml-dev@l...>
- Subject: RE: What is the difference between XSD and DTD
- From: "Michael Kay" <mike@s...>
- Date: Wed, 27 Apr 2005 23:44:20 +0100
- In-reply-to: <20050427213929.16497.qmail@m...>
- Thread-index: AcVLVM4F90EqXzMyQ3qYaYkpkaW9tQAEH6sgAAG8m8AAAMCHkAAAXVlwAAJTfwA=

|
In
fact this is another big advantage of XML
Schema over DTD. With DTDs, a document is valid if it conforms to any DTD chosen
by the document author, which might have been arbitrarily modified to make the
document valid. The recipient knows it's valid against some DTD, but they have
no idea if it's the right DTD. With XML Schema, the document recipient can
specify which schema should be used for
validation.
Michael Kay
Hi,
By "cross validate" I mean :
Lets
say Party1 provides an XML document to party2 and before that party1 sends the
corresponding XSD document to party2.
Then
how does party2 validate the given XML document ? There may be many
goofing things, Manual validation does not work for an XML document
containing 1000s of records.
Where as, had it been in DTD, the parser would have validated the XML
document[say IE browser]. Because DTD is defined in same XML document itself
and DTD itself is not a separate doc as opposed to XSD.
That's what my understanding is. Can you please
correct me ?
Regards,
RNS
In terms of validation functionality, XSD can define
all the constraints that a DTD can define, and many more. To take a simple
example, XSD can say that a particular attribute must be a valid date, or a
number, or a list of URIs, or a string that is exactly 8 characters long. To
take another example, XSD can define much richer constraints on uniqueness
of values within a document.
I've no idea what you mean by "cross validate". I
believe the only things you can do with a DTD that you can't do with an XML
Schema are things that have nothing to do with validation: notably, defining
entities.
Michael Kay
http://www.saxonica.com/
Hello,
Can anybody please explain me the real difference between
XSD and DTD. Because both are used to define the schema of an XML
document.
Whereas DTD is more powerful in the sense that XML parser can cross
validate an XML document based on its DTD, and this is really useful in
business world as XML is mostly used to exchange the data between
parties.
On the other hand XSD defines the schema in XML syntax only which
is more readable, but XML parser CAN NOT cross validate one XML document
based on a given XSD.
Then I am not understanding why people go for XSD
?
Can some body correct me please !
Thanks in advance,
Regards,
Rabindra Nath
Saha
The information contained in this e-mail may
be confidential and is intended solely for the use of the named
addressee.
Access, copying or re-use of
the e-mail or any information contained therein by any other person is not
authorized.
If you are not
the intended recipient please notify us immediately by returning the
e-mail to the originator.(17b)
The information contained in this e-mail may be
confidential and is intended solely for the use of the named
addressee.
Access, copying or re-use of the
e-mail or any information contained therein by any other person is not
authorized.
If you are not the
intended recipient please notify us immediately by returning the e-mail to the
originator.(16b)
|

|
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format
| RSS 2.0 |
 |
| Atom 0.3 |
 |
| |
Stylus Studio has published XML-DEV in RSS and ATOM formats,
enabling users to easily subcribe to the list from their preferred news reader application.
|
Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website.
they were not included by the author in the initial post. To view the content without the Sponsor Links please
click here.
|
|