WIF:DTD
From WikiSym
Here you can find a draft of the WIF DTD. This DTD has been created by modifying the XHTML 1.0 Specs, so that any valid WIF document is XHTML 1.0 valid as well.
Open Issues
Some points need to be discussed and clarified. They are summarized below, according to IBAW (http://wiki.xam.de/2006-02-ibaw.html).
issue: Do we need elements' identifiers (attribute ID)?
- idea: they are preserved in all elements
- pro: fine-frained references
- con: non-relevant information, not needed to generate wiki-syntax from WIF
issue: Internationalization
- idea: preserving all attributes related to I18N
- pro: XHTML-complaint
- pro: independent from the language of a document
- con: too much information
- ACTION: make more clear what exactly these atributes are and what purpose they have
issue: HTML Header. Which is the content-type of the element HEAD?
- idea: it contains only TITLE, BASE and META*
- pro: simple and unambiguous
- con: too restrictive, imposes rules over the order of the elements
- idea: the more strict WIF is, the easier it is to transform it back to something else
issue: Do we need the element STYLE?
- idea: deleting all information about style and formatting (both element and attribute STYLE)
- pro: presentational information are not relevant for WIF (agree: Max)
issue: do we need the element LINK?
- idea: preserving the element LINK or using it to link external resources
- pro: it can be useful to link RDFa files or something else
- issue: do we need all its attributes?
- pro: it can be useful to link RDFa files or something else
- idea: a is enough.
- ACTION: check XHTML 1.1, XHTML 2.0 and RDFa for preferred solution
issue: do we need the element META?
- idea: using it to any kind of metadata
- pro: general and powerful
- pro: XHTML compliant
- issue: do we need all its attributes?
- pro: used by RDFa, otherwise no full RDFa
- ACTION: investigate RDFa
issue: Definition list. Which is the content-type of the element DL?
- idea: it can contain only text or in-line elements
- pro: simple and unambiguous
- con: too restrictive (agree: max)
- idea: DL contains (DT,DD)+
issue: Subtractive context. Do we need to explicitly exclude some elements from PRE?
- issue with the issue: what means "subtractive" content?
- idea: making different its content-model
- pro: detailed and case-specific
- con: more complex
- idea: including all inlines as in P
- pro: general and simple
- pro: input documents do not include those forbidden elements
- con: not detailed and case-specific
issue: Subtractive context. Do we need to explicitly exclude some elements from A?
- idea: making different its content-model
- pro: detailed and case-specific (agree: max)
- con: more complex
- idea: including all inlines as in I, B, etc.
- pro: general and simple
- pro: input documents do not include those forbidden elements
- con: not detailed and case-specific
<!--
WIF: Wiki Interchange Format - Version 1.0 DTD
This is a subset of XHTML 1.0, used as interchange format for wikis.
For further information, see: http://www.wikisym.org/wiki/index.php/WSR_3
$Revision: 1.0 $
$Date: 2006/08/28 $
-->
== DTD ==
<!--================ Character mnemonic entities =========================-->
<!ENTITY % HTMLlat1 PUBLIC
"-//W3C//ENTITIES Latin 1 for XHTML//EN"
"xhtml-lat1.ent">
%HTMLlat1;
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
<!ENTITY % HTMLspecial PUBLIC
"-//W3C//ENTITIES Special for XHTML//EN"
"xhtml-special.ent">
%HTMLspecial;
<!--================== Imported Names ====================================-->
<!-- a space separated list of character encodings, as per [RFC2045] -->
<!ENTITY % LanguageCode "NMTOKEN">
<!-- a language code, as per [RFC3066] -->
<!ENTITY % Number "CDATA">
<!-- one or more digits -->
<!ENTITY % URI "CDATA">
<!-- a Uniform Resource Identifier, see [RFC2396] -->
<!ENTITY % Text "CDATA">
<!-- used for titles etc. -->
<!--=================== Generic Attributes ===============================-->
<!-- core attributes common to most elements
id document-wide unique id
class space separated list of classes
-->
<!ENTITY % coreattrs "id ID #IMPLIED
class CDATA #IMPLIED
">
<!-- internationalization attributes
lang language code (backwards compatible)
xml:lang language code (as per XML 1.0 spec)
dir direction for weak/neutral text
-->
<!ENTITY % i18n "lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
dir (ltr|rtl) #IMPLIED">
<!ENTITY % attrs "%coreattrs; %i18n;">
<!--=================== In-line level elements ====================================-->
<!ENTITY % special "img ">
<!ENTITY % fontstyle "tt | i | b">
<!ENTITY % phrase "sub | sup ">
<!ENTITY % inline "a | %special; | %fontstyle; | %phrase;">
<!ENTITY % Inline "(#PCDATA | %inline;)*">
<!--================== Block level elements ==============================-->
<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
<!ENTITY % lists "ul | ol | dl">
<!ENTITY % blocktext "pre | hr">
<!ENTITY % block "p | %heading; | %lists; | %blocktext; | table">
<!ENTITY % Block "(%block;)*">
<!--================== Content models for exclusions =====================-->
<!-- a elements use %Inline; excluding a -->
<!ENTITY % a.content "(#PCDATA | %special; | %fontstyle; | %phrase;)*">
<!-- pre uses %Inline excluding big, small, sup or sup -->
<!ENTITY % pre.content "(#PCDATA | a | %fontstyle; | %phrase;)*">
<!--================ Document Structure ==================================-->
<!ELEMENT html (head, body)>
<!ATTLIST html
%i18n;
id ID #IMPLIED
xmlns %URI; #FIXED "http://www.w3.org/1999/xhtml"
>
<!--================ Document Head =======================================-->
<!ENTITY % head.misc "(meta)*">
<!-- content model is %head.misc; combined with a single
title and an optional base element in any order -->
<!ELEMENT head (base, title, %head.misc;)>
<!ATTLIST head
%i18n;
id ID #IMPLIED
>
<!-- The title element is not considered part of the flow of text.
It should be displayed, for example as the page header or
window title. Exactly one title is required per document.
-->
<!ELEMENT title (#PCDATA)>
<!ATTLIST title
%i18n;
id ID #IMPLIED
>
<!-- document base URI -->
<!ELEMENT base EMPTY>
<!ATTLIST base
href %URI; #REQUIRED
id ID #IMPLIED
>
<!-- generic metainformation -->
<!ELEMENT meta EMPTY>
<!ATTLIST meta
%i18n;
id ID #IMPLIED
http-equiv CDATA #IMPLIED
name CDATA #IMPLIED
content CDATA #REQUIRED
scheme CDATA #IMPLIED
>
<!--=================== Document Body ====================================-->
<!ELEMENT body %Block;>
<!ATTLIST body
%attrs;
>
<!--=================== Paragraphs =======================================-->
<!ELEMENT p %Inline;>
<!ATTLIST p
%attrs;
>
<!--=================== Headings =========================================-->
<!--
There are six levels of headings from h1 (the most important)
to h6 (the least important).
-->
<!ELEMENT h1 %Inline;>
<!ATTLIST h1
%attrs;
>
<!ELEMENT h2 %Inline;>
<!ATTLIST h2
%attrs;
>
<!ELEMENT h3 %Inline;>
<!ATTLIST h3
%attrs;
>
<!ELEMENT h4 %Inline;>
<!ATTLIST h4
%attrs;
>
<!ELEMENT h5 %Inline;>
<!ATTLIST h5
%attrs;
>
<!ELEMENT h6 %Inline;>
<!ATTLIST h6
%attrs;
>
<!--=================== Lists ============================================-->
<!-- Unordered list -->
<!ELEMENT ul (li)+>
<!ATTLIST ul
%attrs;
>
<!-- Ordered (numbered) list -->
<!ELEMENT ol (li)+>
<!ATTLIST ol
%attrs;
>
<!-- list item -->
<!ELEMENT li %Block;>
<!ATTLIST li
%attrs;
>
<!-- definition lists - dt for term, dd for its definition -->
<!ELEMENT dl (dt | dd)+>
<!ATTLIST dl
%attrs;
>
<!ELEMENT dt %Inline;>
<!ATTLIST dt
%attrs;
>
<!ELEMENT dd %Inline;>
<!ATTLIST dd
%attrs;
>
<!--=================== Horizontal Rule ==================================-->
<!ELEMENT hr EMPTY>
<!ATTLIST hr
%attrs;
>
<!--=================== Preformatted Text ================================-->
<!-- content is %Inline; excluding "img|sub|sup" -->
<!ELEMENT pre %pre.content;>
<!ATTLIST pre
%attrs;
xml:space (preserve) #FIXED "preserve"
>
<!--================== The Anchor Element ================================-->
<!-- content is %Inline; except that anchors shouldn't be nested -->
<!ELEMENT a %a.content;>
<!ATTLIST a
%attrs;
href %URI; #IMPLIED
>
<!ELEMENT sub %Inline;>
<!-- subscript -->
<!ATTLIST sub
%attrs;
>
<!ELEMENT sup %Inline;>
<!-- superscript -->
<!ATTLIST sup
%attrs;
>
<!ELEMENT tt %Inline;>
<!-- fixed pitch font -->
<!ATTLIST tt
%attrs;
>
<!ELEMENT i %Inline;>
<!-- italic font -->
<!ATTLIST i
%attrs;
>
<!ELEMENT b %Inline;>
<!-- bold font -->
<!ATTLIST b
%attrs;
>
<!--=================== Images ===========================================-->
<!--
To avoid accessibility problems for people who aren't
able to see the image, you should provide a text
description using the alt and longdesc attributes.
In addition, avoid the use of server-side image maps.
Note that in this DTD there is no name attribute. That
is only available in the transitional and frameset DTD.
-->
<!ELEMENT img EMPTY>
<!ATTLIST img
%attrs;
src %URI; #REQUIRED
alt %Text; #REQUIRED
>
<!--======================= Tables =======================================-->
<!-- Derived from IETF HTML table standard, see [RFC1942] -->
<!ELEMENT table (tr+)>
<!ELEMENT tr (th | td)+>
<!ELEMENT th %Block;>
<!ELEMENT td %Block;>
<!ATTLIST table
%attrs;
>
<!ATTLIST tr
%attrs;
>
<!-- th is for headers, td for data and for cells acting as both -->
<!ATTLIST th
%attrs;
rowspan %Number; "1"
colspan %Number; "1"
>
<!ATTLIST td
%attrs;
rowspan %Number; "1"
colspan %Number; "1"
>