Jæja, þá er vefþjóðin búin að taka
við sér XHTML væðingin er í hámarki, allir
vilja vera með. Þangað til að validateinu kemur, alls konar
óskiljanlegar villur og andvökunætur eru nóg til þess
að hrekja meðalamanninn í burt.
<p>Nei, nei. En &thorn;a&eth; hafa margir veri&eth; a&eth; spyrja spurninga &iacute;
sambandi vi&eth; XHTML validation. Og var &eacute;g be&eth;in um a&eth; skrifa
grein um &thorn;etta efni h&eacute;r &aacute; huga, og &aacute;kva&eth; &eacute;g
a&eth; taka &thorn;eirri &aacute;skorun, safna&eth;i saman algengustu villunum
og reyni a&eth; &uacute;tsk&yacute;ra hvernig m&aacute; for&eth;ast &thorn;&aelig;r
eftir bestu getu.</p>
<p>H&eacute;r kemur svo listinn, hann er ekki t&aelig;mandi, og ef &thorn;a&eth;
er eitthva&eth; sem &eacute;g gleymi, &thorn;&aacute; ef &eacute;g &thorn;ekki
ykkur, dissi&eth; &thorn;i&eth; mig fyrir &thorn;a&eth;!</p>
<p>&THORN;essi listi er yfir villur sem <a href="http://validator.w3.org“ target=”_blank">http://validator.w3.org</a>
kemur me&eth; vi&eth; a&eth; validata XHTML 1.0 strict.</p>
<p><br>
<b>Fatal Error: no document type declaration; will parse without validation
</b><br>
&Iacute; XHTML ver&eth;ur a&eth; skilgreina af hva&eth;a tegund skjali&eth;
er, hvort &thorn;a&eth; s&eacute; HTML e&eth;a XHTML, hva&eth;a version og af
hva&eth;a &quot;styrkleika&quot;.<br>
&THORN;essu er b&aelig;tt vi&eth; &iacute; fyrstu l&iacute;nuna &iacute; skjalinu,
&aacute; undan &lt;html&gt;.<br>
&quot;Strangt&quot;: &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;<br>
&quot;Venjulegt&quot; : &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0
Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;<br>
Ef nota&eth; er frameset: &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0
Frameset //EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;</p>
<p>F&oacute;lk ver&eth;ur bara a&eth; &aacute;kve&eth;a fyrir sj&aacute;lft sig
hva&eth; &thorn;a&eth; vill nota, sj&aacute;lf nota &eacute;g strict, &thorn;a&eth;
er a&eth;eins meira vesen, en &thorn;egar ma&eth;ur kemst upp &aacute; lag me&eth;
&thorn;a&eth; er &thorn;a&eth; l&iacute;ti&eth; m&aacute;l. Svo er l&iacute;ka
gott, ef ma&eth;ur er a&eth; fara validatea s&iacute;&eth;u sem er skrifu&eth;
&iacute; HTML 3.2, e&eth;a 4 a&eth; byrja &aacute; a&eth; validatea hana &iacute;
transitional, og f&aelig;ra sig svo yfir &iacute; strict &thorn;egar ma&eth;ur
er komin upp &aacute; lag me&eth; &thorn;etta allt saman.<br>
</p>
<p><b>Warning: No Character Encoding detected! To assure correct validation, processing,
and display, it is important that the character encoding is properly labeled.</b><br>
&THORN;a&eth; er betra a&eth; skilgreina hva&eth;a stafasett er nota&eth;. Hi&eth;
vestr&aelig;na stafasett (sem vi&eth; notumst vi&eth;) heitir iso-8859-1.<br>
&THORN;essu er semsagt b&aelig;tt vi&eth; skjali&eth;, &iacute; l&iacute;nuna
eftir &lt;!DOCTYPE&gt;<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot; ?&gt;<br>
</p>
<p><b>Error: element &quot;foo&quot; not allowed here; check which elements this
element may be contained within <br>
</b>T&ouml;g ver&eth;a a&eth; vera nestu&eth; r&eacute;tt, &thorn;.e. &lt;b&gt;&lt;i&gt;Foo&lt;/b&gt;&lt;/i&gt;
er &oacute;l&ouml;glegt, &thorn;a&eth; ver&eth;ur a&eth; vera &lt;b&gt;&lt;i&gt;Foo&lt;/i&gt;&lt;/b&gt;,
semsagt t&ouml;gin ver&eth;a a&eth; lokast &iacute; s&ouml;mu r&ouml;&eth; og
&thorn;au voru opnu&eth;. <br>
<br>
Oft kemur &thorn;essi villa &thorn;egar veri&eth; er a&eth; vinna me&eth; t&ouml;flur
og form. &THORN;a&eth; var &aacute;kve&eth;i&eth; &quot;shitmix&quot; a&eth;
setja &lt;form&gt; tagi&eth; einhversta&eth;ar inn &iacute; mi&eth;ja t&ouml;fluna
til &thorn;ess a&eth; fela margini&eth; sem formi&eth; tekur me&eth; s&eacute;r,
&thorn;a&eth; m&aacute; sem sagt ekki. &THORN;a&eth; ver&eth;ur a&eth; opna
&lt;form&gt; &aacute; undan t&ouml;flunni, og loka &thorn;v&iacute; &aacute;
eftir henni. N&uacute; fer f&oacute;lk a&eth; velta fyrir s&eacute;r &thorn;essu
blessa&eth;a margini sem er svo miki&eth; hata&eth;, en &quot;Where there's
will, there's a way&quot; og eins og svo margt anna&eth;, &thorn;&aacute; er
&thorn;essu redda&eth; me&eth; CSS: &lt;form style:&quot;0px, 0px, 0px, 0px&quot;&gt;
og vola, &thorn;v&iacute; vandam&aacute;li redda&eth;.<br>
Ef &thorn;a&eth; er veri&eth; a&eth; vinna me&eth; m&ouml;rg form &aacute; s&ouml;mu
s&iacute;&eth;unni ver&eth;ur a&eth; hafa hvert form inn &iacute; &lt;td&gt;
og byrja &thorn;ar n&yacute;ja t&ouml;flu ef ma&eth;ur vill.<br>
Algeng t&ouml;g sem ma&eth;ur &oacute;vart nestar vitlaust eru: form, td, tr,
table, li, ul.</p>
<p> &Aacute;bending, ef ma&eth;ur indentar k&oacute;&eth;an sinn vel (&eacute;g
nota tv&ouml; space svo hann sj&aacute;ist alltaf eins) &thorn;&aacute; ver&eth;ur
mun einfaldara a&eth; finna svona vitleysur og koma &iacute; veg fyrir fleiri.<br>
</p>
<p><b>Error: end tag for &quot;tr&quot; omitted; end tags are required in XML
for non-empty elements; empty elements require an end tag or the start tag must
end with &quot;/&gt;&quot; </b><br>
&THORN;a&eth; ver&eth;ur a&eth; loka &Ouml;LLUM t&ouml;gum &iacute; XHTML, l&iacute;ka
&thorn;eim sem taka ekkert me&eth; s&eacute;r. Ef t&ouml;g taka einhva&eth;
me&eth; s&eacute;r, t.d umkringja texta &thorn;&aacute; er notu&eth; &thorn;essi
a&eth;fer&eth;: &lt;div&gt;Texti&lt;/div&gt;. Ef t&ouml;gin taka aftur &aacute;
m&oacute;ti ekkert me&eth; s&eacute;r, t.d &lt;br&gt; &thorn;&aacute; er notu&eth;
&thorn;essi a&eth;fer&eth;: &lt;br /&gt;. Bili&eth; &aacute; undan / er sett
til &thorn;ess a&eth; netscape skilji hva&eth; ma&eth;ur er a&eth; gera, en
er algj&ouml;rlega samtkv&aelig;mt sta&eth;linum.<br>
Algengt er a&eth; f&oacute;lk hafi tami&eth; s&eacute;r a&eth; loka ekki eftirfarandi
t&ouml;gum:<br>
br, input, img, meta, option, li. &THORN;ar sem s&iacute;&eth;ustu tv&ouml;
taka eitthva&eth; me&eth; s&eacute;r en hefur ekki veri&eth; nau&eth;synlegt
a&eth; loka hinga&eth; til.<br>
</p>
<p><b>Error: there is no attribute &quot;language&quot; for this element (in this
HTML version)</b><br>
Eftir a&eth; CSS kom til s&ouml;gunar ur&eth;u m&ouml;rg attribute &oacute;&thorn;&ouml;rf
&iacute; HTML og voru rudd &uacute;r vegi fyrir hi&eth; n&yacute;ja og gu&eth;d&oacute;mlega
CSS. &Iacute; XHTML var &thorn;eim einfaldlega hent, og notkun &thorn;eirra
b&ouml;nnu&eth;.<br>
</p>
<table border=“0” cellspacing=“0” cellpadding=“0” width=“438”> <tr> <td>Banna&eth; attribute</td> <td>(m&iacute;n) Lausn </td> </tr> <tr> <td>fyrir <b>&lt;body&gt;</b></td> <td>&nbsp;</td> </tr> <tr> <td>bgcolor</td> <td>endur skilgreina body &iacute; css.</td> </tr> <tr> <td>text</td> <td>endur skilgreina body &iacute; css.</td> </tr> <tr> <td>link</td> <td>nota css selector.</td> </tr> <tr> <td>vlink</td> <td>nota css selector.</td> </tr> <tr> <td>alink</td> <td>nota css selector.</td> </tr> <tr> <td>leftmargin</td> <td>endur skilgreina body &iacute; css.</td> </tr> <tr> <td>topmargin</td> <td>endur skilgreina body &iacute; css.</td> </tr> <tr> <td>marginwidth</td> <td>endur skilgreina body &iacute; css.</td> </tr> <tr> <td>marginheight</td> <td>endur skilgreina body &iacute; css.</td> </tr> <tr> <td>fyrir <b>&lt;td&gt;</b></td> <td>&nbsp;</td> </tr> <tr> <td>width</td> <td>nota myndir til &thorn;ess a&eth; teyja &aacute; cellum.</td> </tr> <tr> <td>height</td> <td>nota myndir til &thorn;ess a&eth; teyja &aacute; cellum.</td> </tr> <tr> <td>bgcolor</td> <td>nota class &iacute; css.</td> </tr> <tr> <td>&lt;img&gt;</td> <td>&nbsp;</td> </tr> <tr> <td>border</td> <td> endurskilgreina img &iacute; css.</td> </tr> <tr> <td>align</td> <td>nota t&ouml;flur til &thorn;ess a&eth; sta&eth;setja myndir, e&eth;a layera.</td> </tr> <tr> <td>fyrir <b>&lt;form&gt;</b></td> <td>&nbsp;</td> </tr> <tr> <td>name</td> <td>er or&eth;i&eth; a&eth; id, sj&aacute; h&eacute;r a&eth; ne&eth;an.</td> </tr> <tr> <td>fyrir <b>&lt;script&gt; </b></td> <td>&nbsp;</td> </tr> <tr> <td>language</td> <td>&iacute; sta&eth;inn fyrir language notar ma&eth;ur type.</td> </tr></table>
<p> Svo voru &ouml;nnur sem var skipt um nafn &aacute;, s.s attributi&eth; &quot;name&quot;
sem miki&eth; var nota&eth; fyrir &lt;form&gt;,&lt;a&gt;,&lt;div&gt; of fleira,
var skipt &uacute;t fyrir &quot;id&quot;, allir browserar skilja &quot;id&quot;
(held &eacute;g allavegna) &thorn;annig a&eth; ykkur er &oacute;h&aelig;tt a&eth;
fara bara og replacea allt &quot;name&quot; fyrir &quot;id&quot;.<br>
</p>
<p><b>Error: attribute values must be quoted in XML <br>
Error: an attribute value must be quoted if it contains any character other
than letters (A-Za-z), digits, hyphens, and periods; use quotes if in doubt
</b><br>
&Ouml;ll attribute ver&eth;a a&eth; vera innan g&aelig;salappa.<br>
</p>
<p><b>Error: element &quot;foo&quot; not defined in this HTML version</b><br>
&THORN;egar XHTML sta&eth;alinn var &thorn;r&oacute;a&eth;ur, var &aacute;kve&eth;i&eth;
a&eth; taka svol&iacute;ti&eth; til &iacute; HTMLinu, sem var or&eth;i&eth;
skuggalega yfirgripsmiki&eth;. &THORN;&aacute; var &aacute;kve&eth;num t&ouml;gum
hennt &uacute;t, fyrir sum komu n&yacute;, &ouml;nnur voru tekin &uacute;t fyrir
CSS. &THORN;etta eru t&ouml;g sem sj&aacute;st sjaldan &iacute; k&oacute;&eth;a
&thorn;essa dagana, en &eacute;g hef heimilidir fyrir &thorn;v&iacute; a&eth;
hugi.is stelist til &thorn;ess a&eth; nota &thorn;au af og til. &THORN;etta
er vondur &aacute;vani, og sparar l&iacute;tinn t&iacute;ma til framt&iacute;&eth;ar.
&Eacute;g hvet ykkur &thorn;v&iacute; a&eth; h&aelig;tta a&eth; skrifa &thorn;essi
l&ouml;ngu &uacute;tdau&eth;u t&ouml;g, og fara a&eth; gera &thorn;a&eth; sem
er r&eacute;tt og gott &iacute; sta&eth;inn.</p>
<p>Me&eth;al &thorn;essara taga eru:<br>
&lt;font&gt;<br>
&lt;center&gt;<br>
&lt;isindex&gt;<br>
&lt;u&gt;&lt;/u&gt;</p>
<p>&Ouml;nnur &aacute;st&aelig;&eth;a fyrir &thorn;essari villu getur veri&eth;
a&eth; t&ouml;gin s&eacute;u skrifu&eth; &iacute; h&aacute;st&ouml;fum, sem
er banna&eth; samkv&aelig;mt XHTML sta&eth;linum. &Ouml;ll t&ouml;g og attribute
eiga a&eth; vera skrifup me&eth; &iacute; l&aacute;gst&ouml;fum.<br>
</p>
<p><b>Error: end tag for element &quot;foo&quot; which is not open; try removing
the end tag or check for improper nesting of elements <br>
</b>&THORN;etta segir n&uacute; eiginlega allt sem segja &thorn;arf. &THORN;essi
villa kemur &thorn;egar tagi er loka&eth; sem hefur ekki veri&eth; opna&eth;.
E&eth;a t&ouml;gin eru vitlaust nestu&eth;. N&uacute; er bara a&eth; fara og
lesa vel yfir k&oacute;&eth;an, til &thorn;ess a&eth; finna vitleysuna.<br>
</p>
<p><b>Error: required attribute &quot;foo&quot; not specified<br>
</b>Sum t&ouml;g hafa &aacute;kve&eth;in grunn attribute sem ver&eth;a a&eth;
vera skilgreind. <br>
&lt;img&gt;: tekur alltaf me&eth; s&eacute;r alt. &THORN;etta er gert fyrir
tal-browsera, og f&oacute;lk sem af einhverri &aacute;st&aelig;&eth;u getur
ekki s&eacute;&eth; myndir. Ef &thorn;i&eth; vilji&eth; ekki hafa alt, &thorn;&aacute;
geti&eth; &thorn;i&eth; haft &thorn;a&eth; t&oacute;mt. alt=&quot;&quot;. &lt;img&gt;
tekur l&iacute;ka me&eth; s&eacute;r width and height, &thorn;etta er g&oacute;&eth;
regla a&eth; temja s&eacute;r til &thorn;ess a&eth; gera s&iacute;&eth;urnar
au&eth;loadanlegri. Ef &thorn;a&eth; er eitthva&eth; vesen me&eth; &thorn;etta,
og &thorn;i&eth; eru&eth; a&eth; nota php (veit ekki hvort &thorn;etta er til
&iacute; asp, og jsp) &thorn;&aacute; er til function sem hetir getImageSize(&quot;mynd.png&quot;)
og skilar arrayi, &iacute; &thorn;ri&eth;ja keyinu &iacute; arrayinu er svo
geymdur textinn width=&quot;breidd myndarinnar&quot; height=&quot;h&aelig;&eth;
myndarinnar&quot;.<br>
&lt;form&gt;: tekur alltaf me&eth; s&eacute;r action. &thorn;egar &thorn;i&eth;
vilji&eth; ekki action, &thorn;&aacute; geti&eth; &thorn;i&eth; bara sett urli&eth;
&aacute; sj&aacute;lfri s&iacute;&eth;unni &iacute; action, gerir sama hlutinn,
jafnvel betur.<br>
&lt;script&gt; og &lt;style&gt;: tekur alltaf me&eth; s&eacute;r type.<br>
</p>
<p><b>Error: unknown entity &quot;foo&quot; <br>
Error: reference not terminated by refc delimiter</b><br>
&THORN;egar XHTML rekst &aacute; &amp; &iacute; texta b&yacute;st hann vi&eth;
special character, eins og &amp;nbsp;. &THORN;egar vi&eth; erum aftur &aacute;
m&oacute;ti a&eth; nota &amp; &iacute; urlum (?nafn=eg&amp;simi=5556666) &thorn;&aacute;
kemur villa, h&uacute;n reynir a&eth; &thorn;&yacute;&eth;a special characterinn
&amp;simi og getur &thorn;a&eth; n&aacute;tt&uacute;rulega ekki, einnig kemur
villa &thorn;v&iacute; &thorn;a&eth; vantar ; eftir special characternum. &THORN;etta
er leyst me&eth; &thorn;v&iacute; a&eth; &iacute; sta&eth;inn fyrir a&eth; sktifa
&amp; &thorn;&aacute; skrifum vi&eth; special characterinn &amp;amp; og allt
rennur eins og skildi.<br>
</p>
<p><b>Error: missing a required sub-element of &quot;foo&quot; </b><br>
Sum t&ouml;g taka alltaf me&eth; s&eacute;r undir t&ouml;g, s.s &lt;table&gt;
tekur me&eth; s&eacute;r &lt;tr&gt; sem tekur me&eth; s&eacute;r &lt;td&gt;
og &lt;select&gt; tekur me&eth; s&eacute;r &lt;option&gt;. Ef &thorn;essi villa
kemur upp &thorn;&aacute; vantar undir tagi&eth;. <br>
</p>
<p><b>Error: value of attribute &quot;foo&quot; cannot be &quot;foobaric&quot;;
must be one of &quot;foobar&quot;, &quot;foobarian&quot;, &quot;tralli&quot;<br>
</b>&THORN;essi villa kemur oftast &thorn;egar ma&eth;ur ruglar saman align
og valign. &THORN;etta er semsagt ekki r&eacute;tt gildi &aacute; attributi
fyrir tag :)<br>
Svona til &thorn;ess a&eth; s&yacute;na &thorn;etta &thorn;&aacute; m&aacute;:<br>
align f&aacute; &quot;left&quot;, &quot;center&quot;, &quot;right&quot;, &quot;justify&quot;,
&quot;char&quot; og<br>
valign f&aacute; &quot;top&quot;, &quot;middle&quot;, &quot;bottom&quot;, &quot;baseline&quot;.<br>
</p>
<p><b>Error: duplicate specification of attribute &quot;foo&quot;<br>
</b>A&eth; sj&aacute;lfs&ouml;g&eth;u m&aacute; ekki tv&iacute;taka attribute,
&thorn;etta ske&eth;ur samt af og til &thorn;egar ma&eth;ur er me&eth; miki&eth;
af attributum, eina lei&eth;in til &thorn;ess a&eth; leysa &thorn;etta er bara
a&eth; &aacute;kve&eth;a hva&eth; ma&eth;ur vill hafa og henda hinu &uacute;t.</p>
<p></p>
<p></p>
<p></p>
<p>Vonandi hj&aacute;lpar &thorn;etta eitthva&eth;. &Eacute;g t&oacute;k eftir &thorn;v&iacute; vi&eth; &thorn;essi skrif m&iacute;n hva&eth; vantar &iacute;slensk
or&eth; fyrir &thorn;ennan i&eth;na&eth;. Spurning um a&eth; einhver m&aacute;lj&ouml;furinn
setjist ni&eth;ur og finni &iacute;slensk or&eth; fyrir: tag, attribute, special
character o.s.frv.</p
*————————-*