Commits

Anonymous committed 40d1adf

Fixed a bug with the fic:title handling in the to-DocBook XSLT.

  • Participants
  • Parent commits e82255e

Comments (0)

Files changed (2)

File perl/modules/XML-Grammar-Fiction/extradata/fiction-xml-to-docbook.xslt

         <info>
         <title>
             <xsl:choose>
-                <xsl:when test="title">
-                    <xsl:value-of select="title" />
+                <xsl:when test="fic:title">
+                    <xsl:value-of select="fic:title" />
                 </xsl:when>
                 <xsl:otherwise>
                     <xsl:value-of select="@xml:id" />

File perl/modules/XML-Grammar-Fiction/t/to-xhtml.t

 use strict;
 use warnings;
 
-use Test::More tests => 28;
+use Test::More tests => 30;
 
 use File::Spec;
 
                 "<i>[0] contains the right contents.",
             );
         }
+
+        # Test the DocBook/XML incorporation of the <title> tag.
+        {
+            my @elems;
+
+            @elems = $db_find->(
+                q{//db:section[@xml:id='goliath']/db:info/db:title}
+            );
+            # TEST*$num_with_styles
+            is (
+                scalar(@elems),
+                1,
+                "DocBook: found one title tag",
+            );
+
+            # TEST*$num_with_styles
+            is ($elems[0]->textContent(), "Goliath's Response", 
+                "title#goliath contains the right content.",
+            );
+        }
     }
 }