Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Official XHTML 1.1 DTDs vs. official XHTML 1.1 XML Schemas

Tags:

html

xml

xhtml

xsd

dtd

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?

like image 460
Lucas Avatar asked Aug 28 '10 10:08

Lucas


People also ask

What is an XML schema?

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.

What is the difference between XSD and DTD?

1. DTD are the declarations that define a document type for SGML. XSD describes the elements in a XML document.

Is another name for XML schema XSD?

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.

What is W3C in XML?

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.


2 Answers

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)

like image 65
4 revs, 2 users 57% Avatar answered Sep 21 '22 16:09

4 revs, 2 users 57%


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.

like image 36
james.garriss Avatar answered Sep 18 '22 16:09

james.garriss