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.
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.
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.
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??
Post by:autobot
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
a bit of art, as a gift, the permaculture playing cards