I have the option of validating XHTML 1.1 documents against the official XHTML 1.1 DTDs (I use the plural because the "main" DTD actually includes several others) or against the official XHTML 1.1 XML Schemas.
Now I know that the XML Schema language is more expressive and powerful and can therefore check for more things. What I'm wondering is whether these "extra" features are actually in use in the official schemas. To put it differently, will validating against these schemas check for more things than validating against these DTDs?
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself.
1. DTD are the declarations that define a document type for SGML. XSD describes the elements in a XML document.
XML Schema is commonly known as XML Schema Definition (XSD). It is used to describe and validate the structure and the content of XML data. XML schema defines the elements, attributes and data types. Schema element supports Namespaces.
XSD (XML Schema Definition), a recommendation of the World Wide Web Consortium (W3C), specifies how to formally describe the elements in an Extensible Markup Language (XML) document.
It's a requirement that anything that validates using the DTD should also validate using the schema.
The conformance definition states that
The document MUST conform to the constraints expressed in Appendix C.
and Appendix C contains the DTDs. Nothing is said about conforming to the schemas which are in Appendix D. Therefore, any extra constraints from the schemas would not be binding, since documents only need to satisfy the DTDs.
(Edited)
The XHTML 1.1 pages for the DTD and XML schema both state, "This appendix is normative." That means they should perform identical validation checks.
So to answer your question: No.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With