Commits

Anonymous committed cf5a1b9

Add the <title> support to the XHTML stylesheet.

  • Participants
  • Parent commits 5a3f8be

Comments (0)

Files changed (2)

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

 <xsl:template match="fic:body">
     <html>
         <head>
-            <title>Story</title>
+            <title>
+                <xsl:value-of select="fic:title" />
+            </title>
         </head>
         <body>
             <div class="screenplay">

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

 use strict;
 use warnings;
 
-use Test::More tests => 16;
+use Test::More tests => 20;
 
 use File::Spec;
 
         is ($title[0]->textContent(), "David vs. Goliath - Part I");
     }
 
+    {
+        my @title = $xhtml_find->(q{//x:html/x:head/x:title});
+
+        # TEST*$num_texts
+        is (
+            scalar(@title),
+            1,
+            "Found one global <x:title>",
+        );
+
+        # TEST*$num_texts
+        is ($title[0]->textContent(), "David vs. Goliath - Part I",
+            "XHTML <title> has good content"
+        );
+    }
+    
     # TEST*$num_texts
     ok (
         (scalar(() = $xhtml_find->(q{//x:div}))