Commits

Shlomi Fish committed 71a5f17

More Vered XMLing.

Comments (0)

Files changed (2)

lib/XML-Grammar-Vered/bad-elements-to-xml.wml

 </info>
 
 <body>
-<h2 id="intro">Introduction</h2>
+<preface xml:id="intro">
+
+<info>
+<title>Introduction</title>
+</info>
 
 <p>
 Often when people ask for help with Perl code, they show Perl code that
 the bike shed arguments</a>), but some of the advice here may still be
 controversial.
 </p>
-
-<h2* id="toc">Table of Contents</h2*>
-
-<toc />
-
-<h2 id="bad-elements">The List of Bad Elements</h2>
+</preface>
+
+<section xml:id="bad-elements">
+<info>
+<title>The List of Bad Elements</title>
+</info>
 
 <define-tag main_list endtag="required" whitespace="delete">
 {#MAIN_LIST#:%body:##}
 </define-tag>
 
-<define-tag bad_code endtag="required">
-<pre class="bad_code">
-\# Bad code:
-
-%body
-</pre>
-</define-tag>
-
 {#MAIN_LIST#}
 
 <define-tag item endtag="required">
 <preserve id h />
 <set-var %attributes />
 
-<item* xml:id="<get-var id />" title="<get-var h />">
+<item* xml:id="<get-var id />">
+<info>
+<title><get-var h /></title>
+</info>
 
 %body
 
 </item*>
 
-</div>
-
 <restore id h />
 </define-tag>
 

lib/XML-Grammar-Vered/vered-xml.rng

         <zeroOrMore>
             <choice>
                 <ref name="blockquote"/>
-                <ref name="para"/>
+                <ref name="p"/>
                 <ref name="ol"/>
                 <ref name="ul"/>
                 <ref name="programlisting"/>
+                <ref name="bad_code"/>
             </choice>
         </zeroOrMore>
     </define>
     <define name="li">
         <element name="vrd:li">
             <oneOrMore>
-                <ref name="para" />
+                <ref name="p" />
             </oneOrMore>
         </element>
     </define>
-    <define name="para">
+    <define name="p">
         <element name="vrd:p">
             <zeroOrMore>
                 <choice>
                     <ref name="text_with_style" />
                     <ref name="span" />
+                    <ref name="a" />
                 </choice>
             </zeroOrMore>
         </element>
             </oneOrMore>
         </element>
     </define>
+    <define name="a">
+        <element name="vrd:a">
+            <ref name="common_attrs" />
+            <oneOrMore>
+                <ref name="text_with_style" />
+            </oneOrMore>
+        </element>
+    </define>
     <define name="b">
         <element name="vrd:b">
             <text />
             <text />
         </element>
     </define>
+    <define name="code_contents">
+        <ref name="common_attrs" />
+        <attribute name="format">
+            <text/>
+        </attribute>
+        <text/>
+    </define>
+    <define name="bad_code">
+        <element name="vrd:bad_code">
+            <ref name="code_contents" />
+        </element>
+    </define>
     <define name="programlisting">
         <element name="vrd:programlisting">
-            <text />
+            <ref name="code_contents" />
         </element>
     </define>
     <define name="info">