Reply to Re: Shortest possible valid HTML document?

Your name:

Reply:


Posted by David Hεsδther on 05/31/06 15:56

Michael Winter <m.winter@blueyonder.co.uk> wrote:

> On 31/05/2006 14:57, Stewart Gordon wrote:
>
> [snip]
>
>> <!DOCTYPE HTML SYSTEM"http://eb.cx/2ef"><title//.
> ^^
> The SGML grammar requires at least one white space character
> between the 'SYSTEM' literal (or public identifier) and the system
> identifier, so I don't think that quite qualifies. :-P
>
> [73] external identifier (10.1.6, 379:1) =
> ( ( "SYSTEM"
> | ( "PUBLIC",
> +ps [65],
> public identifier [74] ) ),
> ?( +ps [65],
> system identifier [75] ) )

No, it requires a _parameter separator_. However, those are not
required in all circumstances. The SGML Handbook (372:15) says this:

| A required ps that is adjacent to a delimiter or another ps can be
| can be omitted if no ambiguity would be created thereby.

Therefore, the document type declaration above is correct.

> As far as I know, the system identifier is a URI reference so a
> relative reference (such as a single letter) is permissible, but I
> could very well be wrong.

You're right.

> In the previous discussion, Jukka seemed
> to imply that an absolute URL was necessary, but that could have
> been due to a limitation of the W3C Validator (which was the
> required validator for the challenge).

Yes, I believe the W3C validator only supports absolute URIs.

> So, if a relative reference is allowed, surely /the/ shortest has
> to be:
>
> <!DOCTYPE html SYSTEM "d"><title//. (35 bytes)

With a properly set up catalog, you can do it even shorter since e.g.
"<!DOCTYPE HTML>" is a syntactically correct document type declaration.
Something like the following should be able to validate against any
HTML DTD:

<!doctype p><p>

Again, this needs a properly set up catalog.

I'm not going to dig deeper into this though, since I don't really see
the point in this exercise :-)

--
David HΓ₯sΓ€ther

[Back to original 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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация