While writing contract-first web services i.e. developing web services that start with the XML Schema/WSDL contract first followed by the Java code second, there are four different ways to define a contract for XML message format. They are:
DTDs have limited namespace support, so they are not suitable for Web services. Relax NG and Schematron certainly are easier than XML Schema. Unfortunately, they are not so widely supported across platforms. Hence the usage of XML Schema is preferred by almost all of the developers.