[Wsuug] April Beer Challenge!

Jeremy Fisher thisisroot at gmail.com
Wed Apr 2 14:43:07 EDT 2008


Did someone say beer?

Doctypes are actually an SGML construct that have lived into the XML age.
It's a one-liner meta-tag (<!) of DTD that announces to the parser what set
of instructions should be used to validate the document, and what to expect
in terms of the document's contents.  DTD, or Document Type Declaration, is
the most basic language for describing XML schemas.  It lets you to describe
what tags are in your document, what order they appear in, how they nest,
and what type of data is contained in those tags.  The Doctype line, while
in DTD syntax, may also declare a schema in another language (such as XML
Schema or Relax-NG).

Of course, you're probably looking for what doctypes are relative to
html/xhtml on the web.  In that case, it's the same one-liner I describe
above, but they announce that the document fits one of a small number of
schemas maintained by the w3c.  You can use the doctype to tell the browser
that your page is HTML or XHTML, what version, and if you want to use a
loose, transitional, or strict schema (each schema enforces tighter
restrictions on tag nesting, termination, etc.).

You should use a doctype anytime you're working with HTML, XHTML, or XML
document.  Unless, of course, you're creating the document specifically to
ruffle Andrew's feathers.

Quirks and standards mode are how the browser validates, renders, and
interoperates with a web document.  If you don't include a doctype, your
browser will likely run in quirks mode, which is how it says "I dunno wtf
you want me to do w/this mess, hoss."  Quirks mode is more forgiving than
standards mode, which is the more strict mode that all enlightened browsers
prefer.




On Wed, Apr 2, 2008 at 11:23 AM, Andrew Jaswa <ajaswa at gmail.com> wrote:

> Alright so its a day late but here we go:
>
> It's a compound challenge but if it wasn't it wouldn't be a challenge
> now would it?
>
> What are the differences between doctypes?
> When should they be used?
> What are quirks and standards modes?
>
> The winner will get a beer on me at the next meeting no strings attached.
>
> The contest ends when I say there is a winner or the last time I check
> my email before the meeting.
>
> So have at it.
>
> Andrew
> _______________________________________________
> Wsuug mailing list
> Wsuug at list.wsuug.org
> http://www.thelinuxlink.net/mailman/listinfo/wsuug
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.thelinuxlink.net/pipermail/wsuug/attachments/20080402/68678683/attachment.html


More information about the Wsuug mailing list