summaryrefslogtreecommitdiff
path: root/CommonMark.dtd
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-12-27 21:51:30 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2014-12-28 16:27:00 -0800
commitd57f3952ca8b9aac16db8243539f4c1c5dbf3c93 (patch)
tree21ff4ae66cc5d6130963172df2badb3a77a4930e /CommonMark.dtd
parentbf44064d09afd04039058a00c32c1532fb5e2b61 (diff)
Added xml writer, to dump the AST in XML.
This is a work-in-progress. CommonMark.dtd gives the DTD for the generated XML. Closes #53.
Diffstat (limited to 'CommonMark.dtd')
-rw-r--r--CommonMark.dtd45
1 files changed, 45 insertions, 0 deletions
diff --git a/CommonMark.dtd b/CommonMark.dtd
new file mode 100644
index 0000000..4ad924b
--- /dev/null
+++ b/CommonMark.dtd
@@ -0,0 +1,45 @@
+<!-- DTD for CommonMark xml export format -->
+<!ELEMENT DOCUMENT
+(BLOCK_QUOTE|LIST|CODE_BLOCK|HTML|PARAGRAPH|HEADER|HRULE)*>
+<!ELEMENT BLOCK_QUOTE
+(BLOCK_QUOTE|LIST|CODE_BLOCK|HTML|PARAGRAPH|HEADER|HRULE)*>
+<!ELEMENT LIST (LIST_ITEM)+>
+<!ATTLIST LIST
+ type (bullet|ordered) #REQUIRED
+ start CDATA #IMPLIED
+ tight (true|false) #REQUIRED
+ delimiter (period|paren) #IMPLIED>
+<!ELEMENT LIST_ITEM
+(BLOCK_QUOTE|LIST|CODE_BLOCK|HTML|PARAGRAPH|HEADER|HRULE)*>
+<!ELEMENT CODE_BLOCK (#PCDATA)>
+<!ATTLIST CODE_BLOCK
+ xml:space CDATA #FIXED "preserve"
+ info CDATA #IMPLIED>
+<!ELEMENT HTML (#PCDATA)>
+<!ATTLIST HTML xml:space CDATA #FIXED "preserve">
+<!ELEMENT PARAGRAPH
+(TEXT|SOFTBREAK|LINEBREAK|CODE|INLINE_HTML|EMPH|STRONG|LINK|IMAGE)*>
+<!ELEMENT HEADER
+(TEXT|SOFTBREAK|LINEBREAK|CODE|INLINE_HTML|EMPH|STRONG|LINK|IMAGE)*>
+<!ATTLIST HEADER level (1|2|3|4|5|6) #REQUIRED>
+<!ELEMENT HRULE EMPTY>
+<!ELEMENT TEXT (#PCDATA)>
+<!ELEMENT SOFTBREAK EMPTY>
+<!ELEMENT LINEBREAK EMPTY>
+<!ELEMENT CODE (#PCDATA)>
+<!ATTLIST CODE xml:space CDATA #FIXED "preserve">
+<!ELEMENT INLINE_HTML (#PCDATA)>
+<!ATTLIST INLINE_HTML xml:space CDATA #FIXED "preserve">
+<!ELEMENT EMPH
+(TEXT|SOFTBREAK|LINEBREAK|CODE|INLINE_HTML|EMPH|STRONG|LINK|IMAGE)*>
+<!ELEMENT STRONG
+(TEXT|SOFTBREAK|LINEBREAK|CODE|INLINE_HTML|EMPH|STRONG|LINK|IMAGE)*>
+<!ELEMENT LINK
+(TEXT|SOFTBREAK|LINEBREAK|CODE|INLINE_HTML|EMPH|STRONG|LINK|IMAGE)*>
+<!ATTLIST LINK url CDATA #REQUIRED>
+<!ATTLIST LINK title CDATA #IMPLIED>
+<!ELEMENT IMAGE
+(TEXT|SOFTBREAK|LINEBREAK|CODE|INLINE_HTML|EMPH|STRONG|LINK|IMAGE)*>
+<!ATTLIST IMAGE url CDATA #REQUIRED>
+<!ATTLIST IMAGE title CDATA #IMPLIED>
+<!ATTLIST ANY sourcepos CDATA #IMPLIED>