[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Newbie encoding query

Subject: RE: Newbie encoding query
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 4 Dec 2002 18:16:39 -0500
christmas document headers
[ Mike Brown]
> 
> Passin, Tom wrote:
> > >From the DTD in the HTML 4.01 Rec -
> > 
> > <!ELEMENT HEAD O O (%head.content;) +(%head.misc;) -- document head 
> > --> <!ELEMENT TITLE - - (#PCDATA) -(%head.misc;) -- 
> document title -->
> > <!ELEMENT HTML O O (%html.content;)    -- document root element -->
> > <!ELEMENT BODY O O (%block;|SCRIPT)+ +(INS|DEL) -- document body -->
> > 
> > Very clear, right?  Those tags are optional.  Aren't you glad you 
> > don't have to design the parser?
> 
> Heh. OK, I was wrong.
> 
> However, the prose in section 7.1 says
> 
>   An HTML 4 document is composed of three parts:
> 
>   1. a line containing HTML version information, 
>   2. a declarative header section (delimited by the HEAD element), 
>   3. a body, which contains the document's actual content. 
> The body may be 
>      implemented by the BODY element or the FRAMESET element. 
> 
>   White space (spaces, newlines, tabs, and comments) may 
> appear before or 
>   after each section. Sections 2 and 3 should be delimited by 
> the HTML 
>   element.
> 
> I see we're back in the should/may/must discussion, but at 
> the very least it sounds like HEAD is not optional, based on 
> that prose, and it sounds like 
> one of either BODY or FRAMESET are required.
> 

There is a distinction - these **elements** do have to be present but
they do **not** have to be delimited by opening and closing tags.  For
example, given an html document the parser knows that it has to start
out with the head element.  The first time it sees an element that
belongs only in the body, like an <h1>, it knows that the head element
has terminated.  The SGML DTD syntax tells you which **tags** have to be
present when you put in an element.  The "O" indicates an optional tag,
the "-" indicates a mandatory tag.

XML parsing is much simpler because there are no optional tags.  SGML
can be much more complicated.

Cheers,

Tom P

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.