Related
s
DOM
HTML
HTML5
MSXML
NAMESPACES
NOT SGML
SAX
SCHEMA
SGML
SVG
TEX
UNICODE
XML CHINESE
XML CONDENSED
XML DUTCH
XSL
D.14 I've already got SGML DTDs: how do
I convert them for use with XML?
There are numerous projects to convert common or popular SGML DTDs to XML format (for example, both the TEI DTD (Lite and full versions) and the DocBook DTD are available in both SGML and XML, in Schema and DTD formats).
No equivalent of the SGML Declaration. So keywords, character set etc are essentially fixed;
Tag minimisation is not allowed, so
<!ELEMENT x - O (A,B)>
becomes
<!ELEMENT X (A,B)>
and
<!ELEMENT x - O EMPTY>
becomes
<!ELEMENT X EMPTY>
;
#PCDATA must
only occur at the extreme left (ie first) in an OR
model, eg
<!ELEMENT x - - (A|B|#PCDATA|C)>
(in SGML) becomes
<!ELEMENT x (#PCDATA|A|B|C)*>
, and
<!ELEMENT x (A,#PCDATA)>
is illegal;
No CDATA, RCDATA elements [declared content];
Some SGML attribute types are not allowed in XML eg NUTOKEN;
Some SGML attribute defaults are not allowed in XML eg CONREF;
Comments cannot be inline to declarations like
<!ELEMENT x - - (A,B) -- an SGML comment in a declaration -->
;
A whole bunch of SGML optional features are not present in XML: all forms of tag minimisation (OMITTAG, DATATAG, SHORTREF, etc); Link Process Definitions; Multiple DTDs per document; and many more: see http://www.w3.org/TR/NOTE-sgml-xml-971215 for the list of bits of SGML that were removed for XML;
And [nearly] last but not least, no CONCUR!
There are some important differences between the internal and external subset portion of a DTD in XML: Marked Sections can only occur in the external subset; and Parameter Entities must be used to replace entire declarations in the internal subset portion of a DTD, eg the following is invalid XML:
<!DOCTYPE x [ <!ENTITY % modelx "(A|B)*"> <!ELEMENT x %modelx;> ]> <x></x>
For more information, see XML by Example: Building E-Commerce Applications (McGrath, 1998).