Chaos Informations System/Chaos News DTD

From C4 Wiki
< Chaos Informations System
Revision as of 01:07, 13 November 2004 by 212.202.55.244 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

die DTD fuer eine chaosnews


<!ELEMENT chaosnews (author, timestamp, category, title+, abstract+, body+, karma*, comment*)    >
<!ATTLIST chaosnews id      CDATA   #REQUIRED>

<!ELEMENT author    (#PCDATA)   >
<!ATTLIST author    email   CDATA   "redaktion@congress.ccc.de" >

<!ELEMENT timestamp (#PCDATA)   >

<!ELEMENT category  (#PCDATA)   >

<!ELEMENT title     (#PCDATA)   >
<!ATTLIST title     xml:lang    CDATA   #REQUIRED>

<!ELEMENT abstract  (#PCDATA | subtitle | paragraph | strong | list | name | image | link | quote | note | code | wiki)*   >
<!ATTLIST abstract  xml:lang      CDATA   #REQUIRED>

<!ELEMENT body  (#PCDATA | subtitle | paragraph | strong | list | name | image | link | quote | note | code | wiki)*   >
<!ATTLIST body  xml:lang      CDATA   #REQUIRED>

<!ELEMENT subtitle  (#PCDATA)   >

<!ELEMENT paragraph (#PCDATA | strong | list | name | image | link | quote | code | note | wiki)*   >

<!ELEMENT strong    (#PCDATA)   >

<!ELEMENT list      (row+ | item+)     >

<!ELEMENT item      (#PCDATA | strong | name | image | link | quote | code | note | wiki)*   >

<!ELEMENT row       (item+)   >

<!ELEMENT name      (#PCDATA)   >
<!ATTLIST name      email       CDATA   #IMPLIED
                    ref         CDATA   #IMPLIED    >

<!ELEMENT image     (#PCDATA)   >
<!ATTLIST image     ref         CDATA   #IMPLIED
                    width       CDATA   #IMPLIED
                    height      CDATA   #IMPLIED    >

<!ELEMENT link      (#PCDATA)   >
<!ATTLIST link      ref         CDATA   #IMPLIED    >

<!ELEMENT quote     (#PCDATA)   >
<!ATTLIST quote     ref         CDATA   #IMPLIED    >

<!ELEMENT code      (#PCDATA)   >

<!ELEMENT note      (#PCDATA)   >

<!ELEMENT wiki      (#PCDATA)   >

<!ELEMENT karma     (#PCDATA)   >
<!ATTLIST karma     ip          CDATA   #REQUIRED   >

<!ELEMENT comment   (author, timestamp, text)   >

<!ELEMENT text      (#PCDATA)   >

Beispiel:

<?xml version="1.0"?>
<!DOCTYPE chaosnews SYSTEM "chaosnews.dtd">
<chaosnews id="134234">
  <author>fd0</author>
  <timestamp>1070488194</timestamp>
  <category>noc</category>
  <title xml:lang="en">Network is up and running again</title>
  <abstract xml:lang="en" />
  <body xml:lang="en">
    <paragraph>The network is up and running again. This is just a stupid
    news created to test the system.</paragraph>
    <paragraph>
      <strong>strong text</strong>
      <list>
        <item> fnord </item>
        <item> strong <strong>text</strong> test </item>
        <item> wiki: use the <wiki>PhoneBook</wiki> </item>
      </list>
    </paragraph>

  </body>
  <karma ip="127.0.0.1">-1</karma>
  <karma ip="127.0.0.2">-1</karma>
  <karma ip="127.0.0.3">1</karma>
  <comment>
    <author>fd0</author>
    <timestamp>1070488194</timestamp>
    <text>just a test</text>
  </comment>
  <comment>
    <author>fd0</author>
    <timestamp>1070488194</timestamp>
    <text>another teste</text>
  </comment>
</chaosnews>

Verbesserungen erwuenscht, ich bau das jetzt erstmal so. :)

Sieht ja fast so aus wie die Chaospage-DTD [1]. Waere ausserdem ganz hilfreich im Club mehr oder weniger eine DTD zu etablieren, um Dokumente zwischen den verschiedenen Systemen auszutauschen.

Warum? Wofuer gibt es XSLT? Doch um XML in XML umzuwandeln, oder nicht?