Commits

Shlomi Fish  committed 404bd5d

Fixes to the XSLT.

Added a db: prefix.

  • Participants
  • Parent commits 44d7c8b

Comments (0)

Files changed (2)

 bad_elements_html: $(BAD_ELEMENTS_XHTML)
 
 $(BAD_ELEMENTS_DB5): $(BAD_ELEMENTS_XSLT) $(BAD_ELEMENTS_SOURCE_XML)
+	jing lib/XML-Grammar-Vered/vered-xml.rng $(BAD_ELEMENTS_SOURCE_XML)
 	xsltproc -o $@ $(BAD_ELEMENTS_XSLT) $(BAD_ELEMENTS_SOURCE_XML)
 	jing rng/docbook.rng $@
 

File src/tutorials/bad-elements/vered-xml-to-docbook.xslt

                 </xsl:choose>
             </db:title>
         </db:info>
-        <xsl:apply-templates select="vrd:blockquote|vrd:p|vrd:ol|vrd:ul|vrd:programlisting|vrd:item|vrd:code_blk" />
+        <xsl:apply-templates select="vrd:blockquote|vrd:p|vrd:ol|vrd:ul|vrd:programlisting|vrd:code_blk|vrd:bad_code" />
+        <xsl:apply-templates select="vrd:item" />
     </section>
 </xsl:template>
 
 <xsl:template match="vrd:bad_code">
-    <programlisting xml:space="preserve" role="bad_code">
+    <db:programlisting xml:space="preserve" role="bad_code">
         <xsl:attribute name="language">
             <xsl:value-of select="@syntax" />
         </xsl:attribute>
 
 </xsl:text>
         <xsl:apply-templates/>
-    </programlisting>
+    </db:programlisting>
 </xsl:template>
 
 <xsl:template match="vrd:code_blk">
-    <programlisting xml:space="preserve">
+    <db:programlisting xml:space="preserve">
         <xsl:attribute name="language">
             <xsl:value-of select="@syntax" />
         </xsl:attribute>
         <xsl:apply-templates/>
-    </programlisting>
+    </db:programlisting>
 </xsl:template>
 
 <xsl:template match="vrd:p">
     <xsl:variable name="d">
         <xsl:value-of select="@d" />
     </xsl:variable>
-    <db:link>
+    <db:link role="perldoc">
         <xsl:attribute name="xlink:href">
             <xsl:text>http://perldoc.perl.org/</xsl:text>
             <xsl:value-of select="$d" />
     <xsl:variable name="f">
         <xsl:value-of select="@f" />
     </xsl:variable>
-    <db:link>
+    <db:link role="perldoc_func">
         <xsl:attribute name="xlink:href">
             <xsl:text>http://perldoc.perl.org/functions/</xsl:text>
             <xsl:value-of select="$f" />
         <xsl:apply-templates/>
     </db:link>
 </xsl:template>
+
 <xsl:template match="vrd:cpan_mod">
-    <db:link>
+    <db:link role="cpan_module">
         <xsl:attribute name="xlink:href">
             <xsl:text>http://metacpan.org/module/</xsl:text>
             <xsl:value-of select="@m" />
     <xsl:variable name="module">
         <xsl:value-of select="@m" />
     </xsl:variable>
-    <db:link>
+    <db:link role="cpan_module">
         <xsl:attribute name="xlink:href">
             <xsl:text>http://metacpan.org/module/</xsl:text>
             <xsl:value-of select="$module" />
     <xsl:variable name="dist">
         <xsl:value-of select="@d" />
     </xsl:variable>
-    <db:link>
+    <db:link role="cpan_dist">
         <xsl:attribute name="xlink:href">
             <xsl:text>http://metacpan.org/release/</xsl:text>
             <xsl:value-of select="$dist" />