Focal Point
HTML Composer: Non-standard doctype declaration

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4647013426

September 20, 2012, 02:06 PM
Francis Mariani
HTML Composer: Non-standard doctype declaration
All around the web you can read about how important it is to have the correct document type declaration (DOCTYPE) in a web page. (W3C Quality Assurance, Web Design Group, A List Apart...) As has previously noted, HTML Composer operates in "Quirks" mode ( Wikipedia). I would love to know why. Why is the document type declaration not complete in HTML Composer designed pages? Why is there an HTML comment line at the top of the page? These two things (comment line above DTD, incomplete DTD) cause problems when using jQuery UI and probably other JavaScript and CSS extensions.

HTML Composer:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

HTML 4.01 Strict:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

HTML 4.01 Transitional:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

HTML 4.01 Frameset:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd">


A List Apart:
quote:
As mentioned in previous ALA articles (and in other interesting places), DOCTYPES are also essential to the proper rendering and functioning of web documents in compliant browsers like Mozilla, IE5/Mac, and IE6/Win.

A recent DOCTYPE that includes a full URI (a complete web address) tells these browsers to render your page in standards–compliant mode, treating your (X)HTML, CSS, and DOM as you expect them to be treated.

Using an incomplete or outdated DOCTYPE—or no DOCTYPE at all—throws these same browsers into “Quirks” mode, where the browser assumes you’ve written old-fashioned, invalid markup and code per the depressing industry norms of the late 1990s.

This message has been edited. Last edited by: Francis Mariani,


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 21, 2012, 12:04 PM
Francis Mariani
246 views and not a comment in sight - pity! I was hoping the minders would pop in.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 22, 2012, 08:55 AM
David Glick
We are using a standard DOCTYPE for transitional.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
September 22, 2012, 12:08 PM
Francis Mariani
Doesn't look like one to me.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 23, 2012, 06:10 AM
Alan B
The DOCTYPE used is incomplete. Without the url portion IE will go into Quirks mode.

Additionally the DOCTYPE must be the first line, the current comment will force Quirks mode also, even if the DOCTYPE is complete.


Alan.
WF 7.705/8.007
September 23, 2012, 08:10 AM
dhagen
Francis,

Be careful what you ask for. You can always edit the HTML and put your own DOCTYPE in there. If/when you change it, some existing IB supplied JS will not work as expected (I've only found 2 things that mess up a bit).

The next time we are in the same location I will give you a "fix" that will automate your DOCTYPE setting ... if you want it.


"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
September 24, 2012, 09:29 AM
Francis Mariani
Thanks dhagen.

I've started putting the HTML 5 doctype ahead of the incomplete HTML Composer one. This allows things like jQuery UI elements to work correctly. I do have to remember to delete the comment that HTML Composer re-adds every time the document is updated.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 24, 2012, 09:44 AM
MathematicalRob
quote:
Originally posted by Francis Mariani:
All around the web you can read about how important it is to have the correct document type declaration (DOCTYPE) in a web page.
. . .


I've wondered the same thing. . . and supply a working doctype in the template I use.

Rob


WebFocus 8201m on Windows; App Studio 8201; Procedures: WebFocus with SQL; HTML Parameter Pages & Dashboard; Output: Excel, HTML, & PDF.
September 24, 2012, 09:56 AM
David Glick
The DOCTYPE used is not incomplete. There is a version that is just:

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

With the comment at the top, it goes into "quirks" mode anyway. That is what "transitional" means as well. In Release 8, we use "strict".


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
September 24, 2012, 10:03 AM
Francis Mariani
David, please point us to a website that states that
< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
is a complete document type, and please explain why HTML Composer, by design, 'goes into "quirks" mode' - wouldn't it be more graceful if it didn't?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 25, 2012, 08:38 AM
David Glick
Francis,

The product does not support anything other than "transitional" until release 8. If you change what we generate, it will not be supported.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
September 25, 2012, 10:49 AM
Francis Mariani
I have to change what you generate to make use of jQuery UI.

<!DOCTYPE HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

You still haven't answered where on the web I can find that the doctype in an HTML Composer created file is valid and complete.

Why is the HTML Composer generated comment the first line in the HTML file? In a standards compliant html file, the doctype should be the first line.

Perhaps if HTML Composer adhered to standards, we wouldn't have to change what is generated. Every time I modify the HTML Composer generated page via the GUI, I have to remove that comment.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 25, 2012, 11:29 AM
Francis Mariani
And here's another reason why I have to edit the code generated by HTML Composer: after applying HotFix 5 the dreaded "rtFileName" issue had reared its head - I have to replace "rtFileName" with "src" every time I use the GUI.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 26, 2012, 07:31 AM
David Glick
The comment at the top of the file is used to tell the Developer Studio framework that the file should be opened in Composer. Now, as far as DOCTYPE goes, I believe I found that Google's page uses the same one we use. Though I cannot check now. You mention standards. We use Microsoft's own HTML parser to generate our pages. I would venture to say that Microsoft is standard.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
September 26, 2012, 09:52 AM
Francis Mariani
It shouldn't be difficult to develop code that reads/puts the "Generated by Report Layout Painter" comment as the second line in an HTML file. Also, the page is not "Generated by Report Layout Painter", but by HTML Composer, or Composer...

Meanwhile, here are a few doctypes around the web, none (including Microsoft.com) match the syntax generated by HTML Composer:


google.com:
<!doctype html>

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

adobe.com:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

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

informationbuilders.com:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

nytimes.com:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

cnn.com:
<!DOCTYPE HTML>

guardian.co.uk:
<!DOCTYPE html>

theglobeandmail.com:
<!DOCTYPE html>

facebook.com:
<!DOCTYPE html>

flickr.com:
<!DOCTYPE html>

thestar.com:
<!DOCTYPE html>

whitehouse.gov:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">

yahoo.com:
<!DOCTYPE html>


_______________________________________________________________________________________________________

WebFOCUS Developer Studio HTML Composer:
<!-- Generated by Report Layout Painter -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">


_______________________________________________________________________________________________________


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
September 27, 2012, 07:20 AM
David Glick
In release 8 we generate "strict" DTD. We also no longer generate a comment line at the top. Incidentally, "Report Layout Painter" was the original name of the facility which is why it is used.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
September 27, 2012, 12:31 PM
Francis Mariani
Here's an interesting article from the Sep-Oct 2012 IBI WebFOCUS Newsletter, Windows IE Browser Mode, Compatibility View, and WebFOCUS IE Browser Support.

A Microsoft article that is suggested reading states "In most cases, we recommend that websites use the HTML5 document type in order to support the widest variety of established and emerging standards, as well as the broadest range of web browsers.".


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
June 13, 2013, 10:36 AM
Tim P.
Has anyone found a solution to this?

Preferably not the ultimatum of going to WF 8...


WebFOCUS App Studio 8.2.02
Windows 7, All Outputs
June 20, 2013, 04:11 PM
njsden
2 options:

1) Manually change the HTML file after you've made any modifications to it in HTML composer, which is what we always do and which Francis described above:

- Remove the comment in the first line
- Set the first line of the document as an HTML 5 declaration:
<!DOCTYPE html>

- Make sure to "fix" your <script> and tags to JavaScript and CSS files external to the MRE, subsituting "src" for "rtFileName"

-or-

Implement some sort of filtering on the application server side (Tomcat or whichever you use) to perform those changes automatically on any HTML response that passes through it.

I think dhagen mentioned something about it in an older post but don't have a reference to it right now.


In WebFOCUS 8, there is out-of-the-box support for HTML5 content (Active reports and Graphs/Charts). I don't know the reasons why they did not make (or have not yet) that an option also for HTML Composer-generated pages, but as David mentioned above, the HTML document will use "strict" and even better, will no longer have that HTML comment at the top of the file which is what makes the browser go into quirks mode so that is a great improvement.

Support for HTML5 in HTML Composer as a Document option somewhat similar to how they handle encoding would be a nice and I think "obvious" addition but I understand that IBI may need to rework most of their existing controls and supporting JavaScript/CSS to fully support that change.

Now, I saw a demo of the new Application Studio tool and its version of HTML Composer is really, really neat. It uses jQuery out of the box and have some new and nicer widgets; I don't know if it users HTML5 or still relies on HTML 4.01 / strict but it's definitely a big step forward in improving the product.



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.