The Skinny on Schemas - what are they for? why were they developed? can we look at them?

Tom Knowlton
Tom Knowlton used Ask the Experts™
on
Some random examples:

xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
            "http://www.w3.org/TR/html4/strict.dtd">
<!DOCTYPE html>

What are these for?  What is their origin?

Can these references be viewed?  For example, the one for HTML4 I can go to the strict.dtd page, but what about the one for HTML5?  Or are they proprietary / confidential?  How do web programmers take advantage of them?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
Hi Tom,

I am copy-pasting from WikiPedia: https://en.wikipedia.org/wiki/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. These constraints are generally expressed using some combination of grammatical rules governing the order of elements, Boolean predicates that the content must satisfy, data types governing the content of elements and attributes, and more specialized rules such as uniqueness and referential integrity constraints.

You can say they are the guidelines/rules to which a particular XML document has to confirm(if it is a valid one).

You can access the schema by opening it in a browser
Try: http://www.w3.org/TR/html4/strict.dtd

Regards,
Chinmay.
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
A DTD is similar to a schema in function, but it is a separate document type from a schema.

The DTDs for HTML are created/governed by the W3C, which is a standards consortium for things on the Web. You can certainly view the specifications they create as all are hosted on their site. However, HTML 5 does not have a defining DTD (though it does use the !DOCTYPE attribute).
Tom KnowltonWeb developer

Author

Commented:
What does HTML5 use?
Chinmay PatelChief Technology Ninja
Distinguished Expert 2018

Commented:
HTML being a very different language than XML there is no schema for it.

That being said, browsers from the beginning of time are not strictly (with HTML5's !DOCTYPE you can force the browsers to be standard compliant though) standards compliant. I think one of the biggest offender was Microsoft and its implementation of many IE-only features (For example, CSS Gradient support). And HTML5 is not validated via schema per say, there are specs to which your markup has to be compliant.

You can get a list of HTML specs at: https://www.w3.org/WebPlatform/WG/PubStatus#HTML_specifications

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial