You are here: Re: DTDs and syntax « HTML « IT news, forums, messages
Re: DTDs and syntax

Posted by Michael Winter on 09/26/52 11:17

On 30/05/2005 20:56, JimO wrote:

> If DTDs are supposed to enforce syntax rules,

The language - XML in this case - specifies the syntax rules. The DTD
defines what elements are permitted in the document, and how they should
(or should not) be used to structure the document. Neither enforce any
rules.

> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
> <b><i>italics bold</b></i>
> <img src="images/bacon.jpg">

[snip]

> Shouldn't I get an error message or the code just won't work?

If you're serving this as application/xhtml+xml and the user agent is a
'conforming user agent' (in the specification sense), then as I
understand it, the software should flag that as syntax error and stop
parsing. If it's also a validating parser (and it gets far enough into
the document), it should notify you that the markup is invalid.

If those conditions aren't true, the actions taken by a user agent are
implementation dependent.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация