Developers can set the "document type declaration" or "doctype" of their Logi applications. Though it appears as the very first thing in an HTML/XHTML page, the doctype is not an HTML tag; instead it's an instruction to the web browser that identifies the version of the markup language the page is written in. This topic discusses the doctype options in Logi products.
The HTML standards recognize a "document type declaration" (or "doctype") which is an instruction to the web browser that indicates which version of the markup language the page is written in. The doctype is a key component of standards-compliant web pages. Doctype tells modern browsers how they should apply HTML and CSS standards in rendering a page. These include more recent versions of Firefox, Chrome, Internet Explorer, Opera, and Safari. The doctype may include a URL reference to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that browsers can render the content correctly. If an invalid, or no, doctype is specified in an HTML page, browsers go into "quirks" mode, where they each handle the markup in different and, possibly, outdated ways.
In Logi Studio, as shown above, the doctype is configured using the Doctype Declaration attribute of the General element in the _Settings definition. Five options are available using the pull-down selection list. HTML5 is the default value if no DocType Declaration value is selected or entered. If None is selected, no doctype instruction is added to the HTML pages generated by the Logi Server Engine. The other four options are discussed individually in the following sections.
When this option is selected for the Doctype Declaration attribute, the following is placed at the beginning of the generated HTML page: <!DOCTYPE HTML> This declares the document to be HTML5, which is not based on SGML and therefore does not require a reference to a DTD like other doctype declarations. It's the fifth revision of the HTML standard and its core aims have been to improve the language, adding support for the latest multimedia content, while keeping code easily readable by humans and consistently understood by computers and devices. HTML5 is intended to subsume not only HTML 4, but also XHTML 1 and DOM Level 2 HTML.
When this option is selected for the Doctype Declaration attribute, the following is placed at the beginning of the generated HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> This declares the document to be the XML version of HTML 4.01 Strict. This is a trimmed-down version of HTML 4.01 that emphasizes structure over presentation. Deprecated elements (such as Font) and attributes (including most presentational attributes), frames, and link targets are not allowed in HTML 4 Strict. Style can be applied only through style sheets. By writing to HTML 4 Strict, developers can achieve accessible, structurally-rich reports that easily adapt to style sheets and different browsing situations. However, HTML 4 Strict documents may look bland on very old browsers that lack support for style sheets.
When this option is selected for the Doctype Declaration attribute, the following is placed at the beginning of the generated HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> This declares the document to be the XML version of HTML 4.01 Transitional. HTML 4 Transitional includes all of the elements and attributes of HTML 4 Strict and adds presentational attributes, deprecated elements, and link targets. For example, style tags can be included right in the HTML.
When the Doctype Declaration attribute value is left blank, this is the default option. When this option is in effect or selected, the following is placed at the beginning of the generated HTML page: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"> This declares the document to be the XML version of HTML 4.01 Frameset. HTML 4 Frameset includes all of the elements and attributes of HTML 4 Transitional and adds support for HTML frames. This is the most "generous" doctype and supports the most features in an HTML document.
So, how does the choice of a particular doctype impact a Logi application? It can have quite an impact. XHTML Frameset provides a "loose" standard that encompasses everything, and the HTML generated by the Logi Server Engine did not generally cause any DTD-related problems. The default option, HTML5, may result in significant rendering differences in different browsers. And, if you select None, meaning use no doctype, you will almost certainly see presentation (CSS) differences between browsers. Things won't always be aligned correctly, and style may not be applied where or how you expect it, with the most problems occurring in Internet Explorer. And, in complimentary action, if you are seeing differences in the way different browsers present your report pages, the use of a doctype may fix that.