XML technologies / XML / XML in a Nutshell / XML on the Web / Compound documents with modular XHTML modules

(Excerpt from “XML in a Nutshell” by Elliotte Rusty Harold & W. Scott Means)

XHTML 1.1 divides the three XHTML DTDs into modules. Parameter entities combine them by including or omitting particular modules. Examples include:

Adding XHTML to your applications

Modularization lets you choose what you need. Include the tables module if your document uses tables; omit it otherwise. You receive only the functionality you actually require.

Suppose you design a DTD for a catalog. Each entry is a katalog_eintrag element. Each katalog_eintrag contains the elements name, preis, produkt_nummer, farbe, größe and other familiar catalog fields. Each katalog_eintrag also has a beschreibung of the item. The beschreibung contains formatted narrative text, for example:

<katalog_eintrag>
   <name>Aluminium-Stopfen</name>
   <preis>34,99</preis>
   <produkt_nummer>54X8</produkt_nummer>
   <farbe>silber</farbe>
   <größe>XL</größe>
   <beschreibung>
      <p>Dieser starke <strong>silber</strong>farbene Stöpsel verschönert die <em>besten Küchen</em>. Er ist ein wunderbares Geschenk für</p>
      <ul>
        <li>Weihnachten</li>
        <li>Geburtstage</li>
        <li>Muttertag</li>
      </ul>
      <p>und alle anderen Gelegenheiten!</p>
   </beschreibung>
</katalog_eintrag>

Writing this markup is easy; validation is harder. Rather than reinvent a complete DTD for narrative formatting, reuse XHTML. The XHTML 1.1 DTD uses parameter entity references extensively for content models and attribute lists. Three deserve particular attention:

  • %Inline.mix;

    A choice of elements normally requiring no line break, such as em, a and q. It expands to:

    br | span | em | strong | dfn | code | samp | kbd | var | cite | abbr | acronym | q | tt | i | b | big | small | sub | sup | bdo | a | img | map | applet | ruby | input | select | textarea | label | button | ins | del | script | noscript

  • %Block.mix;

    A choice of elements normally requiring line breaks, such as b, blockquote and ul. It expands to:

    h1 | h2 | h3| h4 |h5 | h6| ul| ol| dl| p | div | pre| blockquote | address | hr |table | form | fieldset | ins | del | script | noscript

  • %Flow.mix;

    A choice including both preceding entity references; it expands to:

    h1 | h2 | h3 | h4 | h5 | h6 | ul | ol | dl | p | div | pre | blockquote | address | hr | table | form | fieldset | br | span | em | strong | dfn | code | samp | kbd | var | cite | abbr | acronym | q | tt | i | b | big | small | sub | sup | bdo | a | img | map | applet | ruby | input | select | textarea | label | button | ins | del | script | noscript

Declare that the element beschreibung can contain essentially any valid XHTML fragment:

<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
%xhtml;
<!ELEMENT beschreibung (#PCDATA | %Flow.mix;)*>

To restrict beschreibung at the top level to block elements, declare instead:

<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11.dtd">
%xhtml;
<!ELEMENT beschreibung ((%Block.mix;)*)>

The first two lines import the XHTML driver DTD from a relative URL. Obtain it and its dependencies from the W3C ZIP archive. The second line uses a reference defined there to specify the content model of beschreibung.

Note: The XHTML 1.1 driver DTD imports modules from “Modularization of XHTML” and “Ruby Annotation” through absolute W3C URLs. Without reliable high-speed Internet, consider the flattened DTD: xhtml11-flat.dtd. It combines all modules into one file.

Unfortunately, this DTD includes too much: not just desired HTML such as p, em and ul, it includes elements unsuitable for printed catalogs such as a, applet, map and many others. You can omit these. The main DTD imports each module in an INCLUDE/IGNORE block, illustrated here with hypertext:

<!-- Hypertext Module (required) ................................. -->
<!ENTITY % xhtml-hypertext.module "INCLUDE" >
<![%xhtml-hypertext.module;[<!ENTITY % xhtml-hypertext.mod PUBLIC "-//W3C//ELEMENTS XHTML Hypertext 1.0//EN "http://www.w3c.org/TR/xhtml-moularization/DTD/xhtml-hypertext-1.mod" >%xhtml-hypertext.mod;]]>

If the parameter entity reference %xhtml-hypertext.module; was previously defined as IGNORE rather than INCLUDE, that declaration wins: elements and attributes defined by the hypertext module, especially a, disappear from the resulting DTD.

To use only structure, text and list modules, define the other modules’ parameter entity references as IGNORE, as in the following example.

<!ELEMENT katalog (katalog_eintrag*)>
<!ELEMENT katalog_eintrag (name, preis, produkt_nummer, farbe, größe, beschreibung)>
<!ELEMENT name (#PCDATA)>
<!ELEMENT größe (#PCDATA)>
<!ELEMENT preis (#PCDATA)>
<!ELEMENT produkt_nummer (#PCDATA)>
<!ELEMENT farbe (#PCDATA)>

<!-- entfernt alle Module, die wir nicht benötigen -->
<!ENTITY % xhtml-hypertext.module "IGNORE" >
<!ENTITY % xhtml-ruby.module      "IGNORE" >
<!ENTITY % xhtml-edit.module      "IGNORE" >
<!ENTITY % xhtml-pres.module      "IGNORE" >
<!ENTITY % xhtml-applet.module    "IGNORE" >
<!ENTITY % xhtml-param.module     "IGNORE" >
<!ENTITY % xhtml-bidi.module      "IGNORE" >
<!ENTITY % xhtml-form.module      "IGNORE" >
<!ENTITY % xhtml-table.module     "IGNORE" >
<!ENTITY % xhtml-image.module     "IGNORE" >
<!ENTITY % xhtml-csismap.module   "IGNORE" >
<!ENTITY % xhtml-ssismap.module   "IGNORE" >
<!ENTITY % xhtml-meta.module      "IGNORE" >
<!ENTITY % xhtml-script.module    "IGNORE" >
<!ENTITY % xhtml-style.module     "IGNORE" >
<!ENTITY % xhtml-link.module      "IGNORE" >
<!ENTITY % xhtml-base.module      "IGNORE" >

<!-- importiert die XHTML-DTD, zumindest die Teile, die wir nicht ignorieren. Sie müssen wahrscheinlich den SYSTEM-Identifier ändern, um auf das Verzeichnis zu verweisen, in dem bei Ihnen die DTD gespeichert ist. -->
<!ENTITY % xhtml11.mod PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11/DTD/xhtml11.dtd"> %xhtml11.mod;
<!ELEMENT beschreibung ( %Block.mix; )+>

Code example: A catalog DTD using simple XHTML and omitting selected elements

Adding your applications to XHTML

More importantly, modular XHTML can add elements HTML does not support. To include SVG images, import the SVG DTD and define the parameter entity Misc.extra to allow the SVG root element svg. This merely validates XHTML containing SVG; it does not magically teach browsers to display it. Redefine one of these three parameter entity references:

  • %Inline.extra;

    Place your application root elements here to add them to inline element content models such as span, em, code and textarea.

  • %Block.extra;

    Place your application root elements here to add them to block element content models such as div, h1, p and pre.

  • %Misc.extra;

    Place your application root elements here to add them to both inline and block content models.

Define each parameter entity as a list of elements to add, separated by vertical bars and beginning with one. To add MathML equations both inline and as blocks, import the MathML DTD and define the parameter entity Misc.extra to include the MathML root element math:

 <!ENTITY % Misc.extra "| math"> 

To allow MathML equations and SVG images at block level, import both DTDs and define the parameter entity Block.extra as follows:

 <!ENTITY % Block.extra "| math | svg"> 

Order matters. Both the MathML DTD and the Block.extra declaration must be parsed before XHTML’s DTD. The following example combines MathML 1.0 and XHTML with an additional namespace declaration for good measure.

<!ENTITY % mathml SYSTEM "mathml/mathml.dtd">
%mathml;
<!ATTLIST math xmlns CDATA #FIXED "http://www.w3.org/1998/Math/MathML/">
<!ENTITY % Misc.extra "| math">
<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.1//EN" "xhtml11/DTD/xhtml11.dtd">
%xhtml;

Code example: A DTD incorporating MathML into XHTML

New elements such as math can also be mixed with individual elements such as p without changing every block element. An XHTML element’s content model is defined by a parameter entity named Element.content, for example %p.content;, %em.content; or %td.content;. The default definition of p.content is:

 <!ENTITY % p.content "( #PCDATA | %Inline.mix; )*" > 

To allow math as a child of p elements, but not every block element, redefine p.content like this:

 <!ENTITY % p.content "( #PCDATA | %Inline.mix; | math )*" > 

The XHTML 1.1 DTD is mature. Mixing and matching its parts can achieve many more effects through defining and redefining parameter entities. Read the DTDs themselves to learn these references: their comments are often clearer and more precise than the specification.

Assembling your own XHTML

XHTML 1.1 omits some modules, deliberately excluding frames and legacy presentation elements, which cannot simply be enabled. This is the W3C’s subtle hint not to use them. To include them, create a complete DTD specifying the modules you require.

First define the namespace URI and prefix for your elements and attributes. The W3C offers a template to adapt. The following DTD fragment defines names for the elements today and quoteoftheday used on author Harold’s websites. The module is based on the W3C’s template.

<!-- ................................................................. -->
<!-- CafeML Qualified Names Module ................................... -->
<!-- file: cafe-qname-1.mod

     Dies ist eine Erweiterung von XHTML, einer neuen Variante von HTML als
     eine modulare XML-Anwendung.

     Dieses DTD-Modul wird durch PUBLIC- und SYSTEM-Identifier identifiziert:

     PUBLIC "-//Elliotte Rusty Harold//ELEMENTS CafeML Qualified Names 1.0//EN"
     "cafe-qname-1.mod"

     ................................................................. -->

<!-- NOTES:  Die CafeML Qualified Names Extension benutzen

     Dies ist ein Modul für die Markup-Sprache 'CafeML',
     die momentan zwei Erweiterungselemente deklariert, <quoteoftheday> und <today>.
     Entsprechend der Namenskonvention für Parameter-Entities werden Großbuchstaben für
     den Namen des Entity und Kleinbuchstaben für das Namensraumpräfix verwendet,
     das heißt, dieses Beispiel benutzt 'CAFEML' bzw. 'cafeml'.

     Beachten Sie bitte diese drei Schreibweisen:

         'CafeML'   der Name der Markup-Sprache
         'CAFEML'   wird als Präfix des Namens eines Parameter-Entity verwendet
         'cafeml'   wird als Default-Namensraum-Präfix benutzt

     Das Schlüsselwort %NS.prefixed; für den bedingten Abschnitt muss als
     "INCLUDE" deklariert werden, damit Präfixe benutzt werden können.
-->


<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- CafeML Qualified Names

     Dieses Modul ist in zwei Teilen enthalten, die mit Section 'A' und 'B'
     bezeichnet werden:

       Section A deklariert Parameter-Entities, um namensraumqualifizierte
       Namen, Namensraum-Deklarationen und Namens-Präfixe für CafeML
       zu unterstützen.

       Section B deklariert Parameter-Entities, die benutzt werden, um
       namensraumqualifizierte Namen für alle CafeML-Elementtypen zu ermöglichen.

     Die empfohlene Vorgehensweise zum Erzeugen konformer
     Module ist unten angegeben und umfasst die Module CafeML Qualified
     Names Template und CafeML Extension Template.
-->

<!-- Section A: XHTML XML Namespace Framework :::::::::::::::::::: -->

<!-- 1. Deklariert ein Schlüsselwort %CAFEML.prefixed; für bedingte Abschnitte,
        das verwendet wird, um den Einsatz von Namensraum-Präfixen zu
        aktivieren. Der Standardwert sollte vom DTD-Treiber '%NS.prefixed;'
        erben, so dass das Standardverhalten dem allgemeinen DTD-Präfix-Schema
        entspricht, solange der Wert nicht überschrieben wird.
-->
<!ENTITY % NS.prefixed "IGNORE" >
<!ENTITY % CAFEML.prefixed "%NS.prefixed;" >

<!-- 2. Deklariere ein Parameter-Entity (z.B. %CAFEML.xmlns;), das den
        URI enthält, mit dem der Modul-Namensraum identifiziert wird:
-->
<!ENTITY % CAFEML.xmlns  "http://www.cafeconleche.org/xmlns/cafeml/" >

<!-- 3. Deklariere Parameter-Entities (z.B. %CAFEML.prefix;), die den oder die
        vorgegebenen Namensraum-Präfix-Strings enthalten, die beim Einsatz von Präfixen
        verwendet werden. Diese können im DTD-Treiber oder der internen Teilmenge
        einer Dokumentinstanz überschrieben werden. Wenn kein Default-Präfix erwünscht
        ist, kann das Entity als leerer String deklariert werden.

     HINWEIS: Wie in [XMLNAMES] angegeben, dient das Namensraum-Präfix
     als Proxy für die URI-Referenz und ist selbst nicht entscheidend.
-->
<!ENTITY % CAFEML.prefix  "cafeml" >

<!-- 4. Deklariere Parameter-Entities (z.B. %CAFEML.pfx;), die das oder die Präfixe
        mit Doppelpunkt (z.B. '%CAFEML.prefix;:') enthalten, die verwendet werden, wenn
        der Einsatz von Präfixen aktiviert ist; sonst einen leeren String.
-->
<![%CAFEML.prefixed;[<!ENTITY % CAFEML.pfx  "%CAFEML.prefix;:" >]]>
<!ENTITY % CAFEML.pfx  "" >

<!-- 5. Das Parameter-Entity %CAFEML.xmlns.extra.attrib; kann neu deklariert werden, um
        alle Nicht-CafeML-Namensraum-Attribute für Namensräume aufzunehmen, die in CafeML
        eingebettet werden. Es enthält das xmlns-Attribut und alle Namensraum-
        Deklarationen, die in CafeML eingebettet werden, wenn der Einsatz von Präfixen
        aktiviert wurde, und einen leeren String, falls nicht.
-->
<![%CAFEML.prefixed;[<!ENTITY % CAFEML.xmlns.extra.attrib "xmlns:%CAFEML.prefix; %URI.datatype; #FIXED '%CAFEML.xmlns;' ">]]>
<!ENTITY % CAFEML.xmlns.extra.attrib "" >

<!ENTITY % XHTML.xmlns.extra.attrib "%CAFEML.xmlns.extra.attrib;" >


<!-- Section B: CafeML Qualified Names ::::::::::::::::::::::::::::: -->

<!-- Dieser Abschnitt deklariert Parameter-Entities, die benutzt werden, um
     namensraumqualifizierte Namen für alle CafeML-Elementtypen bereitzustellen.
-->

<!-- module: cafe-1.mod -->
<!ENTITY % CAFEML.quoteoftheday.qname  "%CAFEML.pfx;quoteoftheday" >
<!ENTITY % CAFEML.today.qname   "%CAFEML.pfx;today" >

<!-- end of cafe-qname-1.mod -->

Code example: A DTD fragment defining names and namespaces for today and quoteoftheday

Next define these elements and attributes in your own module. The W3C provides an adaptable template. It uses the same techniques and patterns as XHTML’s modules, including parameter entity references expanding to INCLUDE or IGNORE.

The following DTD fragment defines today and quoteoftheday. The element today allows arbitrary paragraph-oriented content through the parameter entity Block.mix and requires an attribute date. The element quoteoftheday always contains exactly one blockquote element followed by exactly one p element, without attributes.

<!-- ................................................................. -->
<!-- CafeML Extension Module ......................................... -->
<!-- file: CafeML-1.mod
    Dies ist eine Erweiterung von XHTML, einer Neufassung von HTML als
    einer modularen XML-Anwendung.

    Dieses DTD-Modul wird durch PUBLIC- und SYSTEM-Identifier  identifiziert:

      PUBLIC "-//Elliotte Rusty Harold//ELEMENTS CafeML Qualified Names 1.0//EN"
      SYSTEM "CafeML-1.mod"

     Revisionen:
     (keine)
     ................................................................. -->

<!-- Extension Template

     Dieses Template-Modul deklariert zwei Erweiterungselemente,
     <today> und <quoteoftheday>. Entsprechend der Namenskonvention für Parameter-Entities
     werden Großbuchstaben für den Namen des Entity und Kleinbuchstaben für die
     Namensraum-Präfixe verwendet, das heißt, dieses benutzt 'CAFEML' bzw.
     'cafe.ml'.

     Dieses Modul deklariert Parameter-Entities, die benutzt werden, um
     namensraumqualifizierte Namen für alle CafeML-Elementtypen bereitzustellen,
     sowie um als erweiterbares Framework für attributbasierte
     Namensraum-Deklarationen aller Elementtypen zu dienen.

     Das Schlüsselwort %NS.prefixed; für bedingte Abschnitte muss als
     "INCLUDE" deklariert werden, damit Präfixe benutzt werden können.
     Standardmäßig sollten fremde (d.h. Nicht-XHTML-)Namensraum-Module
     %NS.prefixed; von XHTML übernehmen; dies kann aber überschrieben werden, wenn
     nur das Nicht-XHTML-Markup mit Präfixen versehen werden soll.

     Der in XHTML vorgegebene Wert für das 'Namensraum-Präfix' ist ein leerer
     String. Der Präfix-Wert kann entweder in einem DTD-Treiber oder in der internen
     Teilmenge eines Dokuments nach Wunsch neu deklariert werden.

     HINWEIS: Wie in [XMLNAMES] angegeben, dient das Namensraum-Präfix
     als Proxy für die URI-Referenz und ist selbst nicht entscheidend.
-->

<!-- ................................................................  -->

<!-- 1. Deklariert die xmlns-Attribute, die von CAFEML benutzt werden, in Abhängigkeit
        davon, ob der Einsatz von Präfixen in CafeML aktiviert wurde. Dies sollte
        bei allen CafeML-Elementtypen als Bestandteil der üblichen Attribute
        von CafeML eingesetzt werden.

        Wenn in der gesamten DTD Namensraum-Präfixe verwendet werden, sollte CafeML
        %NS.decl.attrib; übernehmen, ansonsten sollte es %NS.decl.attrib; und ein
        xmlns-Attribut auf seinen eigenen Elementtypen deklarieren.
-->
<![%CAFEML.prefixed;[<!ENTITY % CAFEML.xmlns.attrib "%NS.decl.attrib;">]]>
<!ENTITY % CAFEML.xmlns.attrib 
     "xmlns     %URI.datatype;           #FIXED '%CAFEML.xmlns;'"
>

<!-- als Nächstes kommen die diversen Markup-Deklarationen ... -->

<!ENTITY % CAFEML.Common.attrib
     "%CAFEML.xmlns.attrib;
      id           ID                       #IMPLIED"
>

<!-- 2. In der Attributliste jedes Elements werden die XML-Namensräume
        deklariert, die in der Dokumentinstanz zulässig sind. Dazu wird
        jeder ATTLIST das Parameter-Entity %CAFEML.Common.attrib;
        hinzugefügt.
-->

<!ENTITY % CAFEML.today.qname  "today" >
<!ELEMENT %CAFEML.today.qname;  ( %Flow.mix; )* >
<!ATTLIST %CAFEML.today.qname;
      %CAFEML.Common.attrib;
      date CDATA #REQUIRED
>

<!ENTITY % CAFEML.quoteoftheday.qname  "quoteoftheday" >
<!ELEMENT %CAFEML.quoteoftheday.qname;  ( %blockquote.qname;,
                                          %p.qname; ) >
<!ATTLIST %CAFEML.quoteoftheday.qname;
      %CAFEML.Common.attrib;
>

<!-- 3. Wenn das Modul Attribute zu Elementen hinzufügt,
 die in Modulen definiert wurden,
        die nicht den gleichen Namensraum wie dieses Modul haben, deklariere diese
        Attribute so, dass sie das Präfix %CAFEML.pfx; verwenden, z.B.:

<!ENTITY % CAFEML.img.myattr.qname "%CAFEML.pfx;myattr" >
<!ATTLIST %img.qname;
      %CAFEML.img.myattr.qname;  CDATA      #IMPLIED
>

 Das würde dem Element img des Image-Moduls ein Attribut myattr hinzufügen,
 aber der Name des Attributs ist der qualifizierte Name inklusive Präfix,
 wenn Präfixe bei der Dokumentinstanz ausgewählt sind.

 Für dieses Modul brauchen wir das nicht.

-->

<!-- end of CafeML-1.mod -->

Code example: A DTD fragment defining today and quoteoftheday

Next write a document model module defining parameter entities for content models in both CafeML and XHTML modules. This makes your elements part of XHTML elements. The W3C offers no template, but you can usually adapt the XHTML 1.1 or XHTML Basic document model to include your elements. The next example derives from XHTML 1.1.

<!-- ............................................................ -->
<!-- CafeML Model Module  ....................................... -->
<!-- Datei: CafeML-model-1.mod

  PUBLIC "-//Elliotte Rusty Harold//ELEMENTS XHTML CafeML Model 1.0//EN"
  SYSTEM "CafeML-model-1.mod"

     xmlns:cafeml="http://www.cafeconleche.org/xmlns/cafeml"
     ............................................................ -->

<!-- Das Inhaltsmodell für Misc.extra definieren -->
<!ENTITY % Misc.extra
     "| %CAFEML.today.qname; | %CAFEML.quoteoftheday.qname; ">

<!-- ....................  Inline-Elemente  ..................... -->

<!ENTITY % HeadOpts.mix "( %meta.qname; )*" >

<!ENTITY % I18n.class "" >

<!ENTITY % InlStruct.class "%br.qname; | %span.qname;" >

<!ENTITY % InlPhras.class
     "| %em.qname; | %strong.qname; | %dfn.qname; | %code.qname;
      | %samp.qname; | %kbd.qname; | %var.qname; | %cite.qname;
      | %abbr.qname; | %acronym.qname; | %q.qname;" >

<!ENTITY % InlPres.class "" >

<!ENTITY % Anchor.class "| %a.qname;" >

<!ENTITY % InlSpecial.class "| %img.qname; " >

<!ENTITY % Inline.extra "" >

<!-- %Inline.class; fügt alle Inline-Elemente ein, die als Komponente
     in Mischungen verwendet werden
-->
<!ENTITY % Inline.class
     "%InlStruct.class;
      %InlPhras.class;
%InlPres.class;
      %Anchor.class;
      %InlSpecial.class;"
>

<!-- %InlNoAnchor.class; fügt alle Nicht-Anchor-Inline-Elemente ein, die als Komponente in Mischungen verwendet werden
-->

<!ENTITY % InlNoAnchor.class
     "%InlStruct.class;
      %InlPhras.class;
      %InlPres.class;
      %InlSpecial.class;"
>

<!-- %InlNoAnchor.mix; fügt alle Nicht-Anchor-Inline-Elemente ein -->
<!ENTITY % InlNoAnchor.mix
     "%InlNoAnchor.class;
      %Misc.class;"
>

<!-- %Inline.mix; alle Inline-Elemente inklusive %Misc.class; -->
<!ENTITY % Inline.mix
     "%Inline.class;
      %Misc.class;"
>

<!-- .....................  Block-Elemente  ...................... -->
<!ENTITY % Heading.class
     "%h1.qname; | %h2.qname; | %h3.qname;
      | %h4.qname; | %h5.qname; | %h6.qname;" >

<!ENTITY % List.class "%ul.qname; | %ol.qname; | %dl.qname;" >

<!ENTITY % BlkStruct.class "%p.qname; | %div.qname;" >

<!ENTITY % BlkPhras.class
     "| %pre.qname; | %blockquote.qname; | %address.qname;" >

<!ENTITY % BlkPres.class "| %hr.qname;" >

<!ENTITY % Block.extra "" >

<!ENTITY % Table.class "| %table.qname;" >

<!ENTITY % BlkSpecial.class
     "%Table.class;"
>
<!-- %Block.class; bindet alle Block-Elemente ein, die als Komponenten in Mischungen verwendet werden -->
<!ENTITY % Block.class
     "%BlkStruct.class;
      %BlkPhras.class;
      %BlkPres.class;
      %BlkSpecial.class;
      %Block.extra;"
>

<!-- %Block.mix; bindet alle Block-Elemente plus %Misc.class; ein -->
<!ENTITY % Block.mix
     "%Heading.class;
      | %List.class;
      | %Block.class;
      %Misc.class;"
>

<!-- ................  Alle Inhaltselemente  .................. -->

<!-- %Flow.mix; bindet den Textinhalt ein, sowohl als Block wie auch als Inline -->
<!ENTITY % Flow.mix
     "%Heading.class;
      | %List.class;
      | %Block.class;
      | %Inline.class;
      %Misc.class;"
>

<!-- Besonderes Inhaltsmodell für das Element pre -->
<!ENTITY % pre.content
    "( #PCDATA
     | %Inline.class; )*"
>

<!-- Ende von CafeML-model-1.mod -->

Code example: A document model module for CafeML

Finally replace the standard XHTML DTD with one importing your selected standard modules and custom modules. The W3C supplies a template for this too. This template is a minimal DTD performing imports and declaring the parameter entities all other modules depend on. The next example follows it, combining the element module defined in “A DTD fragment defining today and quoteoftheday” with standard tables, images and other XHTML modules.

<!-- ................................................................. -->
<!-- XHTML + CafeML DTD  ............................................. -->
<!-- file: CafeML.dtd -->

<!-- CafeML DTD -->
<!-- Benutzen Sie bitte diesen formalen PUBLIC-Identifier, um sie zu identifizieren:
         "-//Elliotte Rusty Harold//DTD XHTML CafeDTD//EN"
-->
<!ENTITY % XHTML.version  "-//W3C//DTD XHTML CafeDTD//EN" >

<!-- Holt alle Module für qualifizierte Namen, die nicht aus XHTML stammen -->
<!ENTITY % CAFEML-qname.mod SYSTEM "cafe-qname-1.mod">
%CAFEML-qname.mod;

<!-- Definiert alle zusätzlichen, mit Präfixen versehenen Namensräume, auf die diese DTD zurückgreift -->
<!ENTITY % NS.prefixed.extras.attrib "" >

<!-- Definiert das Inhaltsmodell für das zu benutzende Framework -->
<!ENTITY % xhtml-model.mod SYSTEM "CafeML-model-1.mod">

<!-- Für die zukünftige Verwendung mit Dokumentprofilen reserviert -->
<!ENTITY % XHTML.profile  "" >

<!-- Unterstützung für bidirektionalen Text
     Dieses Entity wird eingesetzt, um Elemente und Attribute zu deklarieren,
     die zur Internationalisierung dienen. Setzen Sie es auf INCLUDE
     oder IGNORE, wie es Ihre Markup-Sprache erfordert.
-->
<!ENTITY % XHTML.bidi            "IGNORE" >

<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->
<!-- Prä-Framework-Platzhalter für Neudeklarationen  .................... -->
<!-- An dieser Stelle können Auszeichnungsdeklarationen
     in die DTD vor den Framework-Deklarationen eingefügt werden.
-->
<!ENTITY % xhtml-prefw-redecl.module "IGNORE" >
<![%xhtml-prefw-redecl.module;[%xhtml-prefw-redecl.mod;<!-- Ende von xhtml-prefw-redecl.module -->]]>

<!-- Das Ereignismodul sollte hier eingefügt werden, falls Sie es benötigen. In diesem Beispiel ist es auf IGNORE gesetzt. -->
<!ENTITY % xhtml-events.module "IGNORE" >

<!-- Modular Framework Module  ................................... -->
<!ENTITY % xhtml-framework.module "INCLUDE" >
<![%xhtml-framework.module;[
<!ENTITY % xhtml-framework.mod
     PUBLIC "-//W3C//ENTITIES XHTML 1.1 Modular Framework 1.0//EN"
            "xhtml11-framework-1.mod" >
%xhtml-framework.mod;]]>

<!-- Post-Framework-Platzhalter für Neudeklarationen  ................... -->
<!-- Hier können Auszeichnungsdeklarationen in die DTD eingefügt werden, die den Framework-Deklarationen folgen sollen. -->
<!ENTITY % xhtml-postfw-redecl.module "IGNORE" >
<![%xhtml-postfw-redecl.module;[
%xhtml-postfw-redecl.mod;
<!-- Ende von xhtml-postfw-redecl.module -->]]>

<!-- Textmodul (notwendig)  ............................... -->
<!ENTITY % xhtml-text.module "INCLUDE" >
<![%xhtml-text.module;[
<!ENTITY % xhtml-text.mod
     PUBLIC "-//W3C//ELEMENTS XHTML 1.1 Text 1.0//EN"
            "xhtml11-text-1.mod" >
%xhtml-text.mod;]]>

<!-- Hypertext-Modul (notwendig) ................................. -->
<!ENTITY % xhtml-hypertext.module "INCLUDE" >
<![%xhtml-hypertext.module;[
<!ENTITY % xhtml-hypertext.mod
     PUBLIC "-//W3C//ELEMENTS XHTML 1.1 Hypertext 1.0//EN"
            "xhtml11-hypertext-1.mod" >
%xhtml-hypertext.mod;]]>

<!-- Listenmodul (notwendig)  .................................... -->
<!ENTITY % xhtml-list.module "INCLUDE" >
<![%xhtml-list.module;[
<!ENTITY % xhtml-list.mod
     PUBLIC "-//W3C//ELEMENTS XHTML 1.1 Lists 1.0//EN"
            "xhtml11-list-1.mod" >
%xhtml-list.mod;]]>

<!-- Ihre Module können hier eingefügt werden. Benutzen Sie die oben definierte Grundform,
     und achten Sie darauf, dass Sie für jedes von Ihnen definierte Modul die öffentliche
     FPI-Definition in Ihre Katalog-Datei einfügen. Sie können hier auch die vom W3C
     definierten Module angeben.
-->

<!-- CafeML-Modul (eigenes Modul)  ....................... -->
<!ENTITY % cafeml.module "INCLUDE" >
<![%cafeml.module;[
<!ENTITY % cafeml.mod
     PUBLIC "-//Cafe con Leche//XHTML Extensions today 1.0//EN"
            "CafeML-1.mod" >
%cafeml.mod;]]>

<!-- Tabellenmodul (optional)  ....................... -->
<!ENTITY % xhtml-table.module "INCLUDE" >
<![%xhtml-table.module;[
<!ENTITY % xhtml-table.module
     PUBLIC "-//W3C//ELEMENTS XHTML Tables 1.0//EN"
            "xhtml-table-1.mod" >
%xhtml-basic-table.mod;]]>

<!-- Metamodul (optional)  ....................... -->
<!ENTITY % xhtml-meta.module "INCLUDE" >
<![%xhtml-meta.module;[
<!ENTITY % xhtml-meta.mod
     PUBLIC "-//W3C//ELEMENTS XHTML Meta 1.0//EN"
            "xhtml-meta-1.mod" >
%xhtml-meta.mod;]]>

<!-- Bildmodul (optional)  ....................... -->
<!ENTITY % xhtml-image.module "INCLUDE" >
<![%xhtml-image.module;[
<!ENTITY % xhtml-image.mod
     PUBLIC "-//W3C//ELEMENTS XHTML Images 1.0//EN"
            "xhtml-image-1.mod" >
%xhtml-image.mod;]]>

<!-- Block-Präsentationsmodul (optional)  ....................... -->
<!ENTITY % xhtml-blkpres.module "INCLUDE" >
<![%xhtml-blkpres.module;[
<!ENTITY % xhtml-blkpres.mod
     PUBLIC "-//W3C//ELEMENTS XHTML Block Presentation 1.0//EN"
            "xhtml-blkpres-1.mod" >
%xhtml-blkpres.mod;]]>

<!-- Dokumentstrukturmodul (notwendig)  ....................... -->
<!ENTITY % xhtml-struct.module "INCLUDE" >
<![%xhtml-struct.module;[
<!ENTITY % xhtml-struct.mod
     PUBLIC "-//W3C//ELEMENTS XHTML 1.1 Document Structure 1.0//EN"
            "xhtml11-struct-1.mod" >
%xhtml-struct.mod;]]>

<!-- Ende der CafeML DTD  ............................................ -->
<!-- ................................................................. -->

Code example: An XHTML DTD combined with the Cafe DTD

  

 

 

 

back to top