wood burning stoves 2.0*
The moose likes Product and Other Certifications and the fly likes DTD Vs 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 "DTD Vs Schema" Watch "DTD Vs Schema" New topic
Author

DTD Vs Schema

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I find schemas very much advantageous than DTDs for any kind of scenario...can someone tell when a DTD should be used instead of a schema..I am still not very clear about this.
Karthik Jayaraman
Greenhorn

Joined: May 06, 2003
Posts: 25
There is no hard and fast rule to select a DTD. If you are typing your DTD/ Schema, you would know how painful it is to type a simple schema document. Anyway, schemas are preferred for various advantages but DTDs can still be used if you find it easier to use (like me.)
I think DTDs are strong on entities. I dont think we can use entities/ entitity references/ parameter entities in Schemas.


Karthik Jayaraman.<br />IBM Certified Developer - XML and Related Technologies.<br />Sun Certified Developer for java WebServices.<br />Sun Certified Java Programmer.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
I am not looking at DTDs just because they r precise and easy to type...If it is the matter of typing, there are 101 IDEs to do the job for us...
I am looking at advantages of a DTD over a Schema in a real time b2b or a b2c environment.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Entities can be defined in Schemas using the data type <b>entity</b>. U wouldnt need a parameter entity in a scema as u have <b>include</b> and <b>import</b> to import schemas and <b>ref</b> atribute to reuse the element and attribute definitions. These r much more powerful than parameter entities.
Karthik Jayaraman
Greenhorn

Joined: May 06, 2003
Posts: 25
DTDs can either be internal or external. I think the advantages comes with an internal dtd.
1) Lesser roundtrips to the server:
If the DTD is included in the instance document, the parser need not send a request back to the server to fetch the DTD or schema for validating the instance document. (Not considering public identified DTDs or those that are cached.)
2) Validation can be changed at runtime.
Since the internal DTD subset overrides the external DTD, it can be used for changing the validation rules at runtime in the instance document (This can also be looked at as a disadvantage.)
I am sure this is not convincing, but, I hope these might be some reasons why we may want to have DTDs.
Any suggestions??
 
 
subject: DTD Vs Schema