|
Posted by Michael Winter on 11/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]
|