Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Root element specified by DTD ?

From: Henri Sivonen <hsivonen@---.-->
To: NULL
Date: 6/3/2006 12:18:00 PM

In article <1149239813.134006.175360@i...>,
 "Andy Dingley <dingbat@c...>" <dingbat@c...> 
 wrote:

> My question is, is there any way to author a non-HTML DTD (SGML or XML)
> so as to restrict valid documents to only allow a certain subset of
> their elements to be used as the root element? Can this restriction be
> expressed _entirely_ within a DTD?

No and no. 

RELAX NG can restrict the allowed roots and does not allow the document 
to override. 

> Is this fragment a valid HTML document ?

> <!DOCTYPE div PUBLIC "-//W3C//DTD HTML 4.01//EN"
> "http://www.w3.org/TR/html4/strict.dtd">
> <div>
>     <p>Foo</p>
> </div>

Valid in the SGML sense but not conforming to the HTML 4.01 spec. 
Validity is overrated. DTD-validity is especially overrated.

> Good tutorial refs on DTDs are also welcome. I don't know anything like
> enough on DTD innards.

Since you haven't learning invested in DTDs, unless you have a 
non-negotiable requirement to use them, I suggest learning RELAX NG 
Compact Syntax instead:
http://relaxng.org/compact-tutorial-20030326.html

-- 
Henri Sivonen
hsivonen@i...
http://hsivonen.iki.fi/
Validation Service for RELAX NG: http://hsivonen.iki.fi/validator/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent