JDK-4275630 : stddoclet: generated HTML is invalid with frameset DTD and extra
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.1.8,1.3.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 1999-09-26
  • Updated: 2014-05-05
  • Resolved: 2002-10-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.4.2 mantisFixed
Description
Name: krT82822			Date: 09/26/99

1- To reproduce, run javadoc and examine the output with
   an HTML validator, such as http://validator.w3.org/

2- n/a

3- See above.  I looked at the page for java.net.URL, on
   the JDK 1.3 beta distribution, and noticed that

     * [Fixed in 1.4.2]
       Normal class pages use the frameset DTD, not transitional
       (only documents containing frames may use the
       frameset DTD -- only one file from javadoc)

     * [Fixed in 1.4.2]
       On index.html page, you use a Transitional DOCTYPE on framesets 
       rather than the appropriate frameset DOCTYPE.

     * [Fixed in 1.4.2]
       Many other invalid elements as shown in "Comments" section,
       such as <SCRIPT> requires "type" argument: 
        <SCRIPT type="text/javascript">

       The <SCRIPT> element is currently mistakenly *between*
       the <HEAD> and <BODY> elements.  Try moving it to <HEAD> or <BODY>.
       The w3c validator currently creates a parse tree with a second
       <BODY> tag before the <SCRIPT>

       [Cannot reproduce]
     * Method details have an extra <DL>

     * [FIXED IN 1.4.0]
       In at least that particular page, some HTML
       syntax needs to be escaped ("&lt;" not "<")
       when it's used in examples.  So that text
       turns into garbage ... see "URL(URL,String)".

4- n/a
5- n/a
6- n/a

(But I notice the older "ID=..." bugs are gone, good!)
(Review ID: 95746) 
======================================================================

> Based on the 1.4.0 output:
> http://java.sun.com/j2se/1.4/docs/api/index.html
>
> The javadoc tool that comes with J2SDK 1.4.0 produces invalid HTML output. The
> invalid HTML is generally easy to fix: Use the frameset DTD instead of the
> transitional DTD on frame documents, put JavaScript code in the head instead 
> of between the head and body, and so on.
> ###@###.### (which bounces)

======================================================================

MOVED THE FOLLOWING REPORT TO BUG:
4663254 Generates non-HTML-compliant <A NAME> and <A HREF> anchors  
###@###.### 2002-04-13

Name: boT120536			Date: 01/15/2001


Example from <URL:http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html>:

<A NAME="wait(long, int)"><!-- --></A><H3>
wait</H3>

The name attribute, though declared in the formal part of the DTD as
CDATA, is described in the prose as having name token syntax.  This
means that the parenthesis, comma, and whitespace characters are not
permitted where javadoc puts them.

The two main problems with this stem from the whitespace in
particular:

1.  It's impossible to write an URL containing such an invalid fragment-
    identifier in a plain-text context such as email.  Either it's written
    naked, and is parsed as "...Object.html#wait(long" or it's enclosed
    with "<URL: ... >" brackets and the whitespace is ignored, giving
    "...Object.html#wait(long,int)".

2.  Browsers such as emacs-w3 that do their own whitespace stripping
    on passed URLs cannot follow links from other javadoc HTML, for
    the same reason.

My reading of the spec doesn't allow the use of "%" URL-escaping in
fragment identifiers, so perhaps a better scheme would be to use the
type codes as in the VM - eg "wait.JI" - perhaps using "-" instead of
";" to delimit class names.

Incidentally, the empty A element is probably a bad idea - the above
would be better written as <H3><A NAME="wait.JI">wait</A></H3>
(Review ID: 109616)

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b05
14-06-2004

WORK AROUND Name: krT82822 Date: 09/26/99 n/a ... tools that require even well formed HTML (much less valid stuff) can't work with javadoc output. ======================================================================
11-06-2004

PUBLIC COMMENTS Fixed DOCTYPE by correcting it to: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> for all pages but index.html, which gets the frameset DOCTYPE: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"> These validates with validator.w3.org. Regression test is at <ws>/test/com/sun/javadoc/ValidHtml/ValidHtml.java ###@###.### 2002-09-25
25-09-2002

EVALUATION We would need to be careful about changing the <A HREF> anchors, because that would break bookmarks around the world. In particular, the Java Tutorial relies on these anchors. Unfortunately, I believe HTML does not allow two anchors at the same point (it ignores one of them). doug.kramer@Eng 2001-03-01 Copied report about changing the <A HREF> anchors to bug 4663254 "Generates non-HTML-compliant <A NAME> and <A HREF> anchors". Note that bullet #3, changing "<" to "&lt" has been fixed. ###@###.### 2002-04-13 See the W3C validator output of class page p1/C1.html at: http://validator.w3.org/check?uri=http%3A%2F%2Fjava.sun.com%2Fpeople%2Fdkramer%2Fjavadoc%2Fdocs-skipnav%2Fp1%2FC1.html&charset=%28detect+automatically%29&doctype=%28detect+automatically%29&ss=&outline=&sp=#outline ###@###.### 2002-08-28
28-08-2002