It's a tricky one
How?
If a tree falls in a wood and no-one hears it - does it still
make a noise?
Well, it is tricky one. It certainly makes some air waves, ...
So, kidding aside, invalid is invalid.
Except that validity is a concept that can only be applied to
documents. Is the document valid? Yes. QED? Nope. It's tricky.
Once the document is parsed, the W3C is very clear on the matter: how
these data, nodes, etc., are represented in the internal memory
structure of the client application is entirely up to the vendors --
and I can pretty well assure you that they all do it differently.
However, they must maintain the DOM API, which is designed to work in
specific ways. These ways will permit an in-memory structure of nodes
and attributes that could only be derived from an invalid document if
they were wholly derived from a document; the DOM API permits them,
so they are valid internal structures.
So, validity cannot be applied to the in-memory document, once
parsed. But, of critical importance is that if a variety of vendors
do things differently, and the only thing linking them together is
the validity of the source document. Straying from the interpretation
of that document means you are possibly venturing into areas where
the vendors disagree.
It's not a validity issue; it's a compatibility issue. And, given the
confluence of specs involved (HTML, XML, CSS, DOM), there ought to be
plenty of guaranteed-compatible room outside of what would come from
valid documents. But staying "valid" would be easier, I should think,
though "easier" is not always the primary concern.
"Is it REALLY valid?"
To sum up my position: it's like asking if a deep blue sky with
little puffy clouds if REALLY sweet? Sweet, in this case, has nothing
directly to do with sugar, but how we humans react to sugar.
"Valid" is a term that does not directly apply to the in-memory data
structure; it is, nevertheless, a helpful and analogous concept to
keep in mind. And it helps keep your code sweet.
--
Ben Curtis : webwright
bivia : a personal web studio
http://www.bivia.com
v: (818) 507-6613
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************