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.

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

Posts: 18944

posted 17 years ago

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

Posts: 25

posted 17 years ago

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??