Thursday, January 31, 2013

XSD vs DTD

Both XSD and DTD are used for defining the structure of XML file.

  1. XSD are newer than DTD.
  2. XSD allow making more complicated definitions than DTD (and are recommended to use). 
  3. XSD files are XML files.
  4. In XSD you could put the restriction on the occurrence of the elements. This is done by using attributes minOccurs and maxOccurs.

Some of the features of XSD (that DTD have not) are:
  • support of namespaces;
  • existence of data types;