WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Well formed verses Valid code

for

From: smithj7
Date: Feb 24, 2007 6:00AM


Thanks. What you wrote in this email really helped. I've read your article
twice and will need to return again. Your article brings me even more
questions.

In Florida, the state law says that they will follow 508. Recently one of
the larger state agencies moved from a unix envirnment to an asp envirnment.
The new pages do NOT have a DTD. They only have <html>

I feel that a DTD is important and cleaning-up codes to comply with the DTD
is a first step, to accessiblity. (work for blind services - found some
coding mistakes that cause hic-ups with speech). To me it seems like a web
site should have a DTD and that the syntax should be correct.
----- Original Message -----
From: "Jukka K. Korpela" < <EMAIL REMOVED> >
To: "WebAIM Discussion List" < <EMAIL REMOVED> >
Sent: Saturday, February 24, 2007 2:31 AM
Subject: Re: [WebAIM] Well formed verses Valid code


> On Fri, 23 Feb 2007, <EMAIL REMOVED> wrote:
>
>> I really didn't understand the
>> difference between well formed code and valid.
>
> "Well-formed" is XML jargon and simply means that the data constitutes an
> XML document, i.e. complies with the general syntax rules of XML. This
> means rules like having a matching end tag for every start tag. For
> example, <foo>bar</foo> is well-formed XML whereas <foo>bar</fox> is not.
>
> Thus, "well-formed XML document" means the same as "XML document". The
> background is that people may call their files as "XML documents" loosely,
> meaning that they are meant to be XML documents and look like that, even
> though they may violate the syntax rules.
>
> "Valid" is SGML and XML jargon and means that a document, in addition to
> complying with general syntax rules of SGML and XML, conforms to the
> specific syntax rules defined using a particular formalism called Document
> Type Definition (DTD). For more on this, check
> http://www.cs.tut.fi/~jkorpela/html/validation.html
>
> Technically, "valid HTML document" or "valid XHTML document" are
> synonymous with "HTML document" and "XHTML document", since the
> definitions of HTML and XHTML include a requirement on validity.
>
> Thus, "well-formed" is relevant in XML-based contexts only, and in
> describing what constitutes an XHTML document, for example, the
> "well-formedness" rules are much less restrictive than "validity" rules.
> "Well-formedness" operates at a low syntactic level and does not, among
> other things, deal with tag and attribute names at all, except that they
> contain allowable characters only.
>
>> When I take my site
>> through a validation tool like the one provided on the w3 page, am I
>> getting well formed code, valid code, or both? Of course I mean when I
>> get the pass.
>
> Both, to the extent that the well-formedness concept applies (i.e., you
> are using XHTML or some other XML-based language).
>
> --
> Jukka "Yucca" Korpela, http://www.cs.tut.fi/~jkorpela/
>
>