HTML5 vs XHTML
semanticità o sintatticitàSemanticity or syntacticity??
Table of Contents
Francesco Bertoldi
il problemathe problem
Il codice sorgente di una pagine web può, oggi, essere impostato in base a due grandi specifiche, ogna delle quali ha pregi e difettiThe source code of a webpage can, today, be set up according to two major specifications, each of which has strengths and weaknesses: XHTMl oor HTML5.
i limiti dell'XHTMLlimits of XHTML
una sintatticità non semanticaa non-semantic syntacticity
Dopo un tempo incredibilmente lungo (per il web) il formato XML che avrebbe dovuto sostituire HTML non ha ancora preso piede. Anzi è sostanzialmente inesistente nella quasi totalità dei sitiAfter an incredibly long time (for the web) the XML format that was supposed to replace HTML has not yet caught on. In fact, it is substantially non-existent in almost all the websites..
Per ovviare le difficoltà implicate in XML si è allora fatto ricorso all'XHTML, che avrebbe dovuto facilitare un graduale, soft, slittamento da HTML verso XML. Ma anche XHTML, che pure è stato adottato da molti, moltissimi webmasters, va incontro a difficoltà e critiche; una soprattutto: una sorta di fondamentalismo purista attento di fatto più alla correttezza sintattica che alla efficacia semantica. Il che porta a questo paradosso che il linguaggio di marcatori che avrebbe più di ogni altro garantire la accessibilità delle pagine web è in realtà assolutamente criptico per i sintetizzatori vocali che aiutano i non-vedenti a navigare in internetTo overcome the difficulties involved in XML, XHTML was then used, which was supposed to facilitate a gradual, soft, shift from HTML to XML. But even XHTML, which has been adopted by many webmasters, faces difficulties and criticism. One above all: a sort of purist fundamentalism that is in fact more attentive to syntactic correctness than to semantic effectiveness. Which leads to this paradox that the marker language that would more than any other ensure the accessibility of web pages is actually absolutely cryptic for speech synthesizers that help blind people navigate the internet..
In effetti l'attributo ID, inserito in un generico DIV (una DIV con ID “header”) non dice niente. Per questo è nato il progetto, marginale al W3C, ma da questi riconosciuto, HTML5. Un progetto di marcatori più semantici di XHTML. Tra questi ricordiamo i tagIn fact, the ID attribute, inserted in a generic DIV (a DIV with ID “header”) don't say nothing. This is why the project, marginal to the W3C, but recognized by it, HTML5 was born. A project of more semantic markers than in XHTML. These include tags
- nav (dove porre i menu con linkswhere to place menus with links)
- header (l'area di intestazione principale di una paginathe main header area of a page)
- footer (l'area a piè di paginathe footer area)
- aside (una spalla lateralea side “shoulder”)
i limiti dell'HTML5limits of XHTML
una semanticità non sintatticaa non-syntactically correct semanticity
Il rischio che corre HTML5 è di essere fin troppo facilone; basti pensare al possibile uso del MAIUSCOLO nei tags, o al fatto che ci siano dei tag aperti, ma non chiusi, comeThe risk that HTML5 runs is to be far too easy; just think of the possible use of UPPERCASE in tags, or the fact that there are tags open but not closed, such as
,
,
Inoltre lì'HTML5 non può essere tidato mancando di una DTD riconosciutaFurthermore, HTML5 cannot be “tidied” because it lacks a recognized DTD..
La strada migliore allora sarebbe quella non di rendere XHTML più flessibile e semantico, ad esempio aggiungendo i tags proposti da HTML5 (come header nav, footer) dentro XHTMLThe best way then would be to make XHTML more flexible and semantic, for example by adding the tags proposed by HTML5 (such as header, nav, footer) inside XHTML.