Re: Why HTML should be taught as HTML without pretending it is XML

On Jul 23, 2007, at 11:19 AM, Jon Barnett wrote:

>
> [...]
>
>> No one has ever, as far as I
>> am aware, ever explained in a logical way, what could possibly be
>> wrong with authoring content that adheres to XHTML appendix C. It has
>> simply become a mantra amidst a certain web development clique.
>> ...
>> Those are very minor differences that would only be gotchas for those
>> ignoring Appendix C. Often authors are told to go with external
>> stylesheets and external scripts (so that takes care of CDATA
>> sections). Do that;, don't count on implicit elements; use Unicode
>> characters instead of named character entities and stick with DOM1
>> through DOM3 and you'll be fine (oh and don't count on IE consuming
>> your content). There's no need to raise the Homeland Security alert
>> level over XHTML. It's just a few things to understand about it
>> before vending as XML. However, all that has nothing to do with the
>> other reason for following an appendix C syntax: for its consistency
>> and readability.
>
> [...]
>
> To that, I'll add that document.createElement(), one of the most basic
> DOM methods, creates an element without a namespace.  If this
> quasi-XHTML eventually gets served as XHTML, even
> document.createElement would have unintended consequenses.
>

I forgot to respond to this point. Again, this strikes me as another  
non-issue. When working with documents within just the HTML  
namespace, it's important to be consistent in those DOM calls. I  
don't know of any XHTML implementation that has a problem with  
creatElement() as long as you stick with non-NS methods throughout.  
Obviously , you cannot work with multiple namespace elements within  
one document. However, that should be the biggest caveat of all when  
vending as text/html: do not mix elements from different namespaces.

> [...]

Take care,
Rob

Received on Monday, 23 July 2007 17:41:55 UTC