|
Description
|
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
xxxxx@xxxxx 2002-09-25
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 ("<" 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, customer !)
(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.
> steven_chapel@mcgraw-hill.com (which bounces)
======================================================================
MOVED THE FOLLOWING REPORT TO BUG:
4663254 Generates non-HTML-compliant <A NAME> and <A HREF> anchors
xxxxx@xxxxx 2002-04-13
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)
|
|
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).
xxxxx@xxxxx 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 "<" has been fixed.
xxxxx@xxxxx 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
xxxxx@xxxxx 2002-08-28
|
|
Comments
|
Submitted On 20-FEB-2001
schapel
Here's some more detail on the problems with the HTML that
javadoc generates:
Given the Java source file Empty.java:
public class Empty {
}
The command "javadoc Empty.java" generates HTML with the
following problems:
1. index.html contains a <!DOCTYPE> tag with an
unterminated string.
2. index.html contains an HTML <!DOCTYPE> tag but should
have a Frameset <!DOCTYPE> tag instead.
3. index.html contains a <noframes> element outside of the
<frames> tag. The <noframes> tag should instead be inside
the <frames> tag.
4. All the .html files except index.html contain a Frameset
<!DOCTYPE> tag, but should instead contain HTML <!DOCTYPE>
tags.
5. stylesheet.css contains the value "normal" for the
property "font-size" three times. This value is not valid
for this property.
If you run javadoc with a more complicated Java source
file, or use strict DTDs, or set the W3C CSS validator to
issue warnings, I'm sure you can find a lot more problems.
Submitted On 07-MAR-2002
mdoar
I think you can have two named anchors at the same point in
the HTML file
~Matt
PLEASE NOTE: JDK6 is formerly known as Project Mustang
|