Urls in doctype and html tags

Asked

Viewed 91 times

5

1) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

2) <html xmlns="http://www.w3.org/1999/xhtml">

HTML5 removed the use of Urls in tags <!DOCTYPE html> and <html>, but for each type of Doctype there was a different URL, just like in html.

What was the real purpose of the Urls in the above tags?

1 answer

3


HTML is a language derived from SGML. Before HTML5, HTML conventions tried to maintain the same SGML standards, making an HTML file an SGML file at the same time. However, with the popularity of HTML (which until then was the most used SGML format in the world), in order to "make life easier" for developers, browsers became increasingly flexible about the syntax of the HTML language.

As the guiding principles for the development of HTML5 were compatibility, usefulness and interoperability, it was open to discussion on making the language more flexible, resulting in a language close to SGML, but with some "stick breakers".

While these changes seem unrepresentative, they contribute to traffic reduction and simplify the language, making it less rigorous.

As to your doubt:

1. DOCTYPE

A well defined SGML file, brings a report called DTD (A Document Type Definition - Document Type Definition (DTD)). This information defines and validates the structure, elements and attributes present in an XML file and it is defined by declaration .

The DTD can be completely defined within the SGML file or can be referenced. In the case of HTML the most common (maybe exclusive) practice was to refer to this DTD.

Over time, the HTML link has matured and some elements have been incorporated and even modified, and it is necessary to define variations of the available structures.

To see the list of most common statements and their main features see: http://www.w3schools.com/tags/tag_doctype.asp

After much discussion about the HTML5 structure, W3C defined HTML as a bind with its own characteristics, definitely abandoning the SGML standard (although the features are still quite similar). Therefore, it was agreed, for the sake of compatibility, that the declaration should be used to identify an HTML file. The declaration is required in a file. [http://www.w3.org/TR/html5/syntax.html#syntax-doctype]

For more information about DTD: http://www.w3schools.com/dtd/

2. XMLNS

The XMLNS attribute serves to avoid conflict in element names and attributes in XML files. Remember the XML language derives directly from the SGML language, just as the HTML derived. So unless you are using XHTML, the XMLNS attribute does not have any effect on HTML. [http://www.w3.org/TR/html5/infrastructure.html#xmlns-namespace]

I hope I’ve cured your doubt.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.