Error Message Feedback

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error Message Feedback

Naturally Naomi
Validating [Hello,
I tried to add the <MAP> element to my page (as described on http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), which returned an error in HTML 4.0.1. Strict. What can I do to make the below code HTML 4.0.1 Strict, or should I switch to HTML 4.0.1 Transitional?
"<MAP title="Navigation Bar">
<ul>
  <li><a accesskey="1" href="index.html">Home</a></li>
  <li><a accesskey="2" href="episodes.html">Episodes</a></li>
  <li><a accesskey="3" href="about.html">About
Us</a></li>
  <li><a accesskey="4" href="news.html">News</a></li>
  <li><a accesskey="5" href="testers.html">Testers</a></li>
  <li><a accesskey="6" href="support.html">Support</a></li>
  <li><a accesskey="7" href="webbuilding.html">Website
building</a></li>
  <li><a accesskey="8" href="forum.html">Forum</a></li>
</ul>
</MAP>?,
 
Kind regards,
 
Naomi]


Yahoo! FareChase - Search multiple travel sites in one click.
Reply | Threaded
Open this post in threaded view
|

Re: Error Message Feedback

Frank Ellermann

Naturally Naomi wrote:

> I tried to add the <MAP> element to my page (as described on
> http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), which
> returned an error in HTML 4.0.1. Strict.
[...]
> <MAP title="Navigation Bar">

That example is apparently incomplete, try to use name="navmap"
or similar.  For some more examples see:

http://www.w3.org/TR/html401/struct/objects.html#edef-MAP

                     Bye, Frank



Reply | Threaded
Open this post in threaded view
|

Re: Error Message Feedback

Jukka K. Korpela
In reply to this post by Naturally Naomi
On Sat, 29 Oct 2005, Naturally Naomi wrote:

> Validating [Hello,
> I tried to add the <MAP> element to my page
>(as described on
> http://www.w3.org/TR/WCAG10-HTML-TECHS/#group-bypass), which returned an
> error in HTML 4.0.1. Strict. What can I do to make the below code HTML
> 4.0.1 Strict, or should I switch to HTML 4.0.1 Transitional?

You probably mean HTML 4.01.

> "<MAP title="Navigation Bar">
> <ul>
>  <li><a accesskey="1" href="index.html">Home</a></li>
>  <li><a accesskey="2" href="episodes.html">Episodes</a></li>
>  <li><a accesskey="3" href="about.html">About
> Us</a></li>
>  <li><a accesskey="4" href="news.html">News</a></li>
>  <li><a accesskey="5" href="testers.html">Testers</a></li>
>  <li><a accesskey="6" href="support.html">Support</a></li>
>  <li><a accesskey="7" href="webbuilding.html">Website
> building</a></li>
>  <li><a accesskey="8" href="forum.html">Forum</a></li>
> </ul>
> </MAP>”,
There are many different problems involved. First, what you are doing
to follow certain WCAG 1.0 guidelines on accessibility is an exercise
in futility or worse. Wrapping the list inside a <map> element helps
no one in practice, and using accesskey attributes tends to hurt rather
than help (that's at least the current view of most accessibility
experts) - it may break the functionality of _browser_ shortcuts.

On the technical side, you didn't post the URL of your document. The URL
is relevant even if you have guessed right where the problem is, and
people often haven't. In particular, when you post a snippet of code
(markup), E-mail programs may distort the data. In this case,
one of the problems is probably a no-break space, and who knows
what happens to it in E-mail? (It reached me, but I don't know about
others.)

Among the problems that the validator reports, if we construct a minimal
test document around the <map> element is that the element lacks a
required NAME attribute. Adding name="" would do, since the <map>
markup has no effect anyway - so you might just as well remove
the <map ...> and </map> tags. If you keep the <map> element for
some reason, then you need to wrap it inside a block level container
such as <div> in order to satisfy Strict rules.

The strangest problem, however, is caused by no-break spaces (U+00A0)
inside the <ul> element, at the start of lines, before the <li> tags.
You have indented the <li> elements by using one space and one
no-break space.

I created a trivial test document
http://www.cs.tut.fi/~jkorpela/test/nbsp.html
that has a <ul> element with one <li> element inside it but
with a no-break space before the <li> tag. Here's what the
W3C validator says:

1. Error Line 5 column 0: start tag for "LI" omitted, but its declaration
does not permit this.
¼/strong>?<li></li>

There's something very strange in the report's source.

The WDG validator reports:

Line 5, character 1:
  <li></li>
^Error: start tag for LI omitted

This makes more sense.

The problem with the no-break space is that it is not defined
as a whitespace character. Instead, it is treated as a data character,
so inside a <ul>, it is forbidden except when it appears inside
a <li> element. The validators seem to imply a missing <li> before
the no-break space, which doesn't quite hit the nail in this case.

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Reply | Threaded
Open this post in threaded view
|

Wrong handling of non-ASCII characters

Jukka K. Korpela
On Sun, 30 Oct 2005, Jukka K. Korpela wrote:

> I created a trivial test document
> http://www.cs.tut.fi/~jkorpela/test/nbsp.html
> that has a <ul> element with one <li> element inside it but
> with a no-break space before the <li> tag. Here's what the
> W3C validator says:
>
> 1. Error Line 5 column 0: start tag for "LI" omitted, but its declaration
> does not permit this.
> ¼/strong>?<li></li>
>
> There's something very strange in the report's source.
I was able to reduce the problem to an even more trivial case:
- write a document in ISO-8859-1 encoding
- declare HTML 4.01 Strict DOCTYPE
- use a body part of <body>é</body> (or with any non-ASCII
   character inside the body)

The validator reports "character data is not allowed here",
which is correct, but shows the element oddly:

<body>ü/strong>?</body>

If I manually change the encoding of the report page to ISO-8859-1, I get:

<body>é</body>

This is still wrong, but I guess we can now see what goes wrong.
Here's the source of the error message page (viewed as if it were
Latin 1):

       <li class="msg_err">
<span class="err_type">Error</span>
         <em>Line 4 column 6</em>:
         <span class="msg">character data is not allowed
here</span>.<pre><code class="input">&#60;body&#62;<strong title="Position
where error was detected.">Ã</strong>©&#60;/body&#62;</code></pre>

Thus, the validator has added <strong> markup in a manner that breaks
a sequence of two octets that is meant to be the UTF-8 representation
of a single character ("é" in this case). This produces the octet pair
C3 3C (looks like Ã< if interpreted as ISO-8859-1), and the rest is
a mess.

Deactivating the generation of <strong> markup to highlight the point
of error would be a quick fix.

--
Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
Reply | Threaded
Open this post in threaded view
|

Re: Wrong handling of non-ASCII characters

Frank Ellermann

Jukka K. Korpela wrote:

> Thus, the validator has added <strong> markup in a manner
> that breaks a sequence of two octets that is meant to be
> the UTF-8 representation of a single character ("é" in this
> case).

Good catch, big oops.  Maybe it could do its magic with UTF-32
internally switching to UTF-8 only when what it has to say is
ready.
                        Bye, Frank