Diederik Gerth van Wijk, DTD Manager, Wolters Kluwer Nederland, dgerth@kluwer.nl
Presented on the Extreme Markup Languages 2000 conference, Montréal, 2000.08.18.09.45
This HTML page is based on the slide show used while presenting the paper. It uses CSS to clarify some examples, and is only tested with IE5.5, where it works fine. The full text of the paper is in the conference proceedings, which should be available through GCA.
<!ENTITY % DO.subtitle.IN.parablock "IGNORE"> <![ %DO.subtitle.IN.parablock; [ <!ENTITY % HF.subtitle.IN.parablock "subtitle?, "> ]]> <!ENTITY % HF.subtitle.IN.parablock ""> <!ENTITY % H.parablock "title, %HF.subtitle.IN.parablock"> <!ENTITY % B.parablock "para+"> <!ENTITY % T.parablock ""> <!ENTITY % C.parablock "(%H.parablock; %B.parablock;%T.parablock;)"> <!ELEMENT parablock %C.parablock;>
<!ENTITY % DO.subtitle.IN.parablock "INCLUDE">
Switches can trigger other switches in the central switchboard:
<![ %DO.subtitle.IN.parablock; [
<!ENTITY % DO.subtitle "INCLUDE">
]]>
The only way a user can change his DTD
is by modifying the switch file.
<!ELEMENT pboc (title, para+, source)>a smart editor will automatically open title and the first para when creating pboc.
<!ELEMENT pboc (title?, para+, source)>and then one with more than one source:
<!ELEMENT pboc (title?, para+, source+)>and one with the source as title:
<!ELEMENT pboc ((title?, para+, source+) |(source+, para+))>
<!ENTITY % text "PCDATA | emph | ref | sup | sub %OR.noterefs; %OR.local.floaters;">
<!ENTITY % calstbls PUBLIC "-//SGML Open//DTD Exchange Table Model 19960430//EN"> %calstbls;
<!ENTITY % msgexplan.module "INCLUDE"> <![ %msgexplan.module; [ <!ENTITY % local.msgexplan.attrib ""> <!ENTITY % msgexplan.role.attrib "%role.attrib;"> <!ELEMENT MsgExplan - - (Title?, (%component.mix;)+)> <!ATTLIST MsgExplan %common.attrib; %msgexplan.role.attrib; %local.msgexplan.attrib; > ]]>
<!ELEMENT MsgExplan - - (Title?, (%component.mix;)+)>
<!ENTITY % DO.ugv 'INCLUDE' -- the root element --> <!ENTITY % DO.UGV "INCLUDE" -- the general switch to include UGV like structures -->
<!-- General settings for XML/SGML --> <!ENTITY % DO.XML "IGNORE"> <![ %DO.XML; [ <!-- Tag omission: illegal in XML --> <!ENTITY % NoTagOmit ""> <!ENTITY % EndTagOmit ""> <!ENTITY % BothTagOmit ""> <!ENTITY % StartTagOmit ""> <!ENTITY % SDATA ""> <!ENTITY % NAME "NMTOKEN"> <!ENTITY % NAMES "NMTOKENS"> <!ENTITY % NMTOKEN "NMTOKEN"> <!ENTITY % NMTOKENS "NMTOKENS"> <!ENTITY % NUMBER "NMTOKEN"> <!ENTITY % NUMBERS "NMTOKENS"> <!ENTITY % NUTOKEN "NMTOKEN"> <!ENTITY % NUTOKENS "NMTOKENS"> <!ENTITY % DO.Exclusions "IGNORE"> ]]> <!-- End of XML stuff; now you get the SGML stuff --> <!ENTITY % NoTagOmit "- -"> <!ENTITY % EndTagOmit "- o"> <!ENTITY % BothTagOmit "o o"> <!ENTITY % StartTagOmit "o -"> <!ENTITY % SDATA "SDATA"> <!-- Declared attribute values that are more specific in SGML than XML allows; %NMTOKEN(S) is just added for convenience --> <!ENTITY % NAME "NAME"> <!ENTITY % NAMES "NAMES"> <!ENTITY % NMTOKEN "NMTOKEN"> <!ENTITY % NMTOKENS "NMTOKENS"> <!ENTITY % NUMBER "NUMBER"> <!ENTITY % NUMBERS "NUMBERS"> <!ENTITY % NUTOKEN "NUTOKEN"> <!ENTITY % NUTOKENS "NUTOKENS"> <!ENTITY % DO.Exclusions "INCLUDE"> <!ENTITY % DO.UGV "IGNORE"> <![ %DO.UGV; [ <!ENTITY % DO.A.RunHeadAlg "INCLUDE"> <!ENTITY % DO.A.sX.RunHeadAlg "IGNORE" -- but not in S1-16 --> <!ENTITY % DO.A.contentkind "INCLUDE"> <!ENTITY % DO.A.s1.contentkind "IGNORE" -- but not for element S1 --> <!ENTITY % DO.A.s2.contentkind "IGNORE" -- nor for element S2 --> <!ENTITY % DO.cpart "INCLUDE"> <![ %DO.cpart; [ <!ENTITY % DO.J.annotgpX "INCLUDE" -- allow skipping in annotation group levels --> ]]><!-- %DO.cpart; --> <!ENTITY % DO.J.sX "INCLUDE" -- allow skip section levels S1-16 --> <!ENTITY % DO.s16 "INCLUDE" -- have 16 levels of sections --> <!ENTITY % DO.sX.IN.lq "INCLUDE" -- and in long quotations --> ... <!ENTITY % DO.wctt.IN.sX "INCLUDE"> ]]><!-- %DO.UGV -->
<!ENTITY % DO.hnar "IGNORE"> <![ %DO.hnar; [ <!ENTITY % O.hnar "%EndTagOmit;" -- tag omission --> <!ENTITY % M.hnar "%MF.atext;" -- mixed content --> <!ENTITY % C.hnar "(%M.hnar;)*" -- content model --> <!ENTITY % E.hnar "" -- no exclusions --> <!ELEMENT hnar %O.hnar; %C.hnar; %E.hnar;> <!ENTITY % DO.A.hnar.nr "%DO.A.nr;"> <![ %DO.A.hnar.nr; [ <!ENTITY % A.hnar.nr "%A.nr;"> <!ATTLIST hnar %A.hnar.nr;> ]]> ]]>
<!ENTITY % DO.pboc "IGNORE"> <![ %DO.pboc; [ <!ENTITY % O.pboc "%EndTagOmit;"> <!ENTITY % DO.OPT.ti.IN.pboc "IGNORE"> <![ %DO.OPT.ti.IN.pboc; [ <!ENTITY % OC.ti.IN.pboc "?"> ]]> <!ENTITY % OC.ti.IN.pboc ""> <!ENTITY % DO.ti.IN.pboc "IGNORE"> <![ %DO.ti.IN.pboc; [ <!ENTITY % HF.ti.IN.pboc "ti%OC.ti.IN.pboc;, "> ]]> <!ENTITY % HF.ti.IN.pboc ""> <!ENTITY % H.pboc "%HF.Meta; %HF.ti.IN.pboc;"> <!ENTITY % DO.REQ.para.IN.pboc "IGNORE"> <![ %DO.REQ.para.IN.pboc; [ <!ENTITY % OC.para.IN.pboc "+"> ]]> <!ENTITY % OC.para.IN.pboc "*"> <!ENTITY % REQ.para.IN.pboc "+"> <!ENTITY % DO.MULT.source.IN.pboc "IGNORE"> <![ %DO.MULT.source.IN.pboc; [ <!ENTITY % REQ.source.IN.pboc "+"> <!ENTITY % FAC.source.IN.pboc "*"> ]]> <!ENTITY % REQ.source.IN.pboc ""> <!ENTITY % FAC.source.IN.pboc "?"> <!ENTITY % DO.REQ.source.IN.pboc "IGNORE"> <![ %DO.REQ.source.IN.pboc; [ <!ENTITY % OC.source.IN.pboc "%REQ.source.IN.pboc;"> ]]> <!ENTITY % OC.source.IN.pboc "%FAC.source.IN.pboc;"> <!ENTITY % DO.source.IN.H.pboc "IGNORE"> <!ENTITY % DO.source.IN.T.pboc "IGNORE"> <![ %DO.source.IN.H.pboc; [ <![ %DO.source.IN.T.pboc; [ <!ENTITY % B.pboc "((source%REQ.source.IN.pboc;, para%OC.para.IN.pboc;) |(para%REQ.para.IN.pboc;, source%OC.source.IN.pboc;))"> ]]> <!ENTITY % B.pboc "source%OC.source.IN.pboc;, para%OC.para.IN.pboc;"> ]]> <![ %DO.source.IN.T.pboc; [ <!ENTITY % B.pboc "para%OC.para.IN.pboc;, source%OC.source.IN.pboc;"> ]]> <!ENTITY % B.pboc "para%OC.para.IN.pboc;"> <!ENTITY % T.pboc ""> <!ENTITY % C.pboc "(%H.pboc; %B.pboc; %T.pboc;)"> <!ENTITY % E.pboc ""> <!ELEMENT pboc %O.pboc; %C.pboc; %E.pboc;> ]]><!-- %DO.pboc; -->
%DO.x.IN.y: allow element x in element y
%DO.REQ.x.IN.y: is it required?
%DO.MULT.x.IN.y: multiple?
%DO.J.sX: allow jumping from s3 to s5
%DO.x.IN.H.y: x in the header of y
%DO.L.H.y: header of y is loose (f.i. (title|number|subtitle)* )
((,a),(|b|c)+,(,,)*,(d+|||)?,)becomes
(a,(b|c)+,d*)
(a, %b.IN.x;, c)where %b.IN.x; could be "b" or "" empty; we now say
(a, %HF.b.IN.x; c)where %HF.b.IN.x can be "b," or ""
<![ %DO.OPT.title.IN.pboc; [
<!ENTITY % OC.title.IN.pboc "?">
]]>
<!ENTITY % OC.title.IN.pboc "">
<!ENTITY % H.pboc "title%OC.title.IN.pboc;, ">
then the schema stuff in the internal subset will look like:
<![ %DO.OPT.title.IN.pboc; [
<!ENTITY MINOC.title.IN.pboc "0">
]]>
<!ENTITY MINOC.title.IN.pboc "1">
and in the document:
<complextype name="pboc"> <element ref="title" minoccurs="&MINOC.title.IN.pboc;"/> ... </complextype>
<![ %DO.OPT.title.IN.pboc; [
<!ENTITY % OC.title.IN.pboc "?">
]]>
<!ENTITY % OC.title.IN.pboc "">
<!ENTITY % H.pboc "title%OC.title.IN.pboc;, ">
then the RELAX stuff in the internal subset will look like:
<![ %DO.OPT.title.IN.pboc; [
<!ENTITY % OC.title.IN.pboc "?">
]]>
<!ENTITY % OC.title.IN.pboc "">
and in the document:
<elementRule role="pboc">
<sequence>
<ref label="title" occurs="&OC.title.IN.pboc;"/>
...
</sequence>
</complextype>