DTDs

From Microformats Wiki
Revision as of 17:41, 1 September 2005 by RyanKing (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This is the DTDs generated from the Relax NG Schemas. I've included the various module DTDs directly in the DTD, not sure if that's the right way to do it.

I haven't been able to validate the DTD yet, does anyone know what's wrong here?

This DTD should validate the following snippet as valid XML:

<?xml version="1.0"?>
<xoxo>
<ol>
	<li>Test
		<ol>
			<li>text..</li>
			<li>
				<ul compact="compact">
					<li>xoxo</li>
				</ul>
			</li>
		</ol>
	</li>
</ol>
<ul>
	<li>Test
		<ul>
			<li>text..</li>
		</ul>
	</li>
</ul>
</xoxo>
<?xml encoding="UTF-8"?>

<!-- Datatypes Module -->

<!-- Length defined for cellpadding/cellspacing -->

<!-- nn for pixels or nn% for percentage length -->

<!ENTITY % Length.datatype "#PCDATA">

<!ENTITY % NMTOKENS.datatype "NMTOKENS">

<!-- space-separated list of link types -->

<!ENTITY % LinkTypes.datatype "%NMTOKENS.datatype;">

<!-- single or comma-separated list of media descriptors -->

<!ENTITY % MediaDesc.datatype "#PCDATA">

<!-- pixel, percentage, or relative -->

<!ENTITY % MultiLength.datatype "#PCDATA">

<!-- one or more digits (NUMBER) -->

<!ENTITY % Number.datatype "#PCDATA">

<!-- integer representing length in pixels -->

<!ENTITY % Pixels.datatype "#PCDATA">

<!-- script expression -->

<!ENTITY % Script.datatype "#PCDATA">

<!-- textual content -->

<!ENTITY % Text.datatype "#PCDATA">

<!-- Imported Datatypes ................................ -->

<!-- a single character from [ISO10646] -->

<!ENTITY % Character.datatype "#PCDATA">

<!-- a character encoding, as per [RFC2045] -->

<!ENTITY % Charset.datatype "#PCDATA">

<!-- a space separated list of character encodings, as per [RFC2045] -->

<!ENTITY % Charsets.datatype "#PCDATA">

<!-- media type, as per [RFC2045] -->

<!ENTITY % ContentType.datatype "#PCDATA">

<!-- comma-separated list of media types, as per [RFC2045] -->

<!ENTITY % ContentTypes.datatype "#PCDATA">

<!-- date and time information. ISO date format -->

<!ENTITY % Datetime.datatype "#PCDATA">

<!-- formal public identifier, as per [ISO8879] -->

<!ENTITY % FPI.datatype "#PCDATA">

<!-- a language code, as per [RFC1766] -->

<!ENTITY % LanguageCode.datatype "CDATA">

<!-- a Uniform Resource Identifier, see [URI] -->

<!ENTITY % URI.datatype "CDATA">

<!-- a space-separated list of Uniform Resource Identifiers, see [URI] -->

<!ENTITY % URIs.datatype "#PCDATA">

<!ENTITY % NMTOKEN.datatype "NMTOKEN">

<!ENTITY % ID.datatype "ID">

<!ENTITY % IDREF.datatype "IDREF">

<!ENTITY % IDREFS.datatype "IDREFS">

<!-- Text Module -->

<!ELEMENT br EMPTY>

<!ATTLIST br
  %Core.attrib;>

<!ENTITY % Inline.class "abbr|acronym|br|cite|code|dfn|em|kbd|q|samp
                         |span|strong|var">

<!ENTITY % Inline.model "(#PCDATA|%Inline.class;)*">

<!ELEMENT span %Inline.model;>

<!ATTLIST span
  %Common.attrib;>

<!ELEMENT abbr %Inline.model;>

<!ATTLIST abbr
  %Common.attrib;>

<!ELEMENT acronym %Inline.model;>

<!ATTLIST acronym
  %Common.attrib;>

<!ELEMENT cite %Inline.model;>

<!ATTLIST cite
  %Common.attrib;>

<!ELEMENT code %Inline.model;>

<!ATTLIST code
  %Common.attrib;>

<!ELEMENT dfn %Inline.model;>

<!ATTLIST dfn
  %Common.attrib;>

<!ELEMENT em %Inline.model;>

<!ATTLIST em
  %Common.attrib;>

<!ELEMENT kbd %Inline.model;>

<!ATTLIST kbd
  %Common.attrib;>

<!ELEMENT q %Inline.model;>

<!ATTLIST q
  %Common.attrib;
  cite %URI.datatype; #IMPLIED>

<!ELEMENT samp %Inline.model;>

<!ATTLIST samp
  %Common.attrib;>

<!ELEMENT strong %Inline.model;>

<!ATTLIST strong
  %Common.attrib;>

<!ELEMENT var %Inline.model;>

<!ATTLIST var
  %Common.attrib;>

<!ENTITY % Flow.model "(#PCDATA|%Inline.class;|%Block.class;)*">

<!ELEMENT div %Flow.model;>

<!ATTLIST div
  %Common.attrib;>

<!ELEMENT p %Inline.model;>

<!ATTLIST p
  %Common.attrib;>

<!ELEMENT address %Inline.model;>

<!ATTLIST address
  %Common.attrib;>

<!-- This is redefined by the legacy module to include inlines. -->

<!ENTITY % Block.mix "%Block.class;">

<!ENTITY % Block.model "(%Block.mix;)+">

<!ELEMENT blockquote (%Block.model;)>

<!ATTLIST blockquote
  %Common.attrib;
  cite %URI.datatype; #IMPLIED>

<!ELEMENT pre %Inline.model;>

<!ATTLIST pre
  %Common.attrib;
  xml:space (preserve) #IMPLIED>

<!ENTITY % Heading.attrib "
  %Common.attrib;">

<!ENTITY % Heading.content "%Inline.model;">

<!ELEMENT h1 %Heading.content;>
<!ATTLIST h1
  %Heading.attrib;>

<!ELEMENT h2 %Heading.content;>
<!ATTLIST h2
  %Heading.attrib;>

<!ELEMENT h3 %Heading.content;>
<!ATTLIST h3
  %Heading.attrib;>

<!ELEMENT h4 %Heading.content;>
<!ATTLIST h4
  %Heading.attrib;>

<!ELEMENT h5 %Heading.content;>
<!ATTLIST h5
  %Heading.attrib;>

<!ELEMENT h6 %Heading.content;>
<!ATTLIST h6
  %Heading.attrib;>

<!ENTITY % Heading.class "h1|h2|h3|h4|h5|h6">

<!ENTITY % Block.class "address|blockquote|div|p|pre|%Heading.class;">

<!-- Common Attributes Module -->

<!ENTITY % id.attrib "
  id %ID.datatype; #IMPLIED">

<!ENTITY % class.attrib "
  class %NMTOKENS.datatype; #IMPLIED">

<!ENTITY % title.attrib "
  title CDATA #IMPLIED">

<!ENTITY % Core.attrib "
  %id.attrib;
  %class.attrib;
  %title.attrib;">

<!ENTITY % lang.attrib "
  xml:lang %LanguageCode.datatype; #IMPLIED">

<!ENTITY % I18n.attrib "
  %lang.attrib;">

<!ENTITY % Common.attrib "
  %Core.attrib;
  %I18n.attrib;
  compact (compact) #IMPLIED">

<!ENTITY % CommonIdRequired.attrib "
  id %ID.datatype; #REQUIRED
  %class.attrib;
  %title.attrib;
  %I18n.attrib;">

<!-- List Module -->

<!ELEMENT dl (dt|dd)+>

<!ATTLIST dl
  %Common.attrib;>

<!ELEMENT dt %Inline.model;>

<!ATTLIST dt
  %Common.attrib;>

<!ELEMENT dd %Flow.model;>

<!ATTLIST dd
  %Common.attrib;>

<!ELEMENT ol (li)+>

<!ATTLIST ol
  %Common.attrib;>

<!ELEMENT ul (li)+>

<!ATTLIST ul
  %Common.attrib;>

<!ELEMENT li %Flow.model;>

<!ATTLIST li
  %Common.attrib;>

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

<!ENTITY % Block.class "%List.class;">

<!ELEMENT xoxo (dl|ol|ul)+>