Shlomi Fish avatar Shlomi Fish committed 9c28947

Fixed the tests.

Now everything is working nicely.

Comments (0)

Files changed (4)

Text-Qantor/extradata/qantor-xml-to-xsl-fo.xslt

  />
 
 <xsl:template match="/">
-        <xsl:apply-templates select="//body" />  
+        <xsl:apply-templates select="//qant:body" />
 </xsl:template>
 
-<xsl:template match="body">
+<xsl:template match="qant:body">
     <fo:root>
         <fo:layout-master-set>
             <fo:simple-page-master master-name="A4">
         </fo:layout-master-set>
         <fo:page-sequence master-reference="A4">
             <fo:flow flow-name="xsl-region-body">
-                <xsl:apply-templates select="p" />  
+                <xsl:apply-templates select="qant:p" />
             </fo:flow>
         </fo:page-sequence>
     </fo:root>
 </xsl:template>
 
-<xsl:template match="p">
+<xsl:template match="qant:p">
     <fo:block>
         <xsl:apply-templates />
     </fo:block>
 </xsl:template>
 
-<xsl:template match="b">
+<xsl:template match="qant:b">
     <fo:inline font-weight="bold">
         <xsl:apply-templates />
     </fo:inline>

Text-Qantor/lib/Text/Qantor.pm

 
     $writer->xmlDecl("utf-8");
 
-    $writer->startTag("doc",
+    $writer->startTag([$qantor_xml_ns, "doc"],
         version => "0.1",
         [$xml_ns, "id"] => "index",
         [$xml_ns, "lang"] => "en",
     );
-    $writer->startTag("body");
+    $writer->startTag([ $qantor_xml_ns, "body"]);
 
     my $text;
 
 
     foreach my $p (@{$doc_tree->{Text}->{Raw_Para}})
     {
-        $writer->startTag("p");
+        $writer->startTag([$qantor_xml_ns, "p"]);
         $self->_write_xml_para($p);
         $writer->endTag(); # p
     }

Text-Qantor/lib/Text/Qantor/XML/ToXSL_FO.pm

 =head2 $converter->translate_to_xsl_fo({source => {file => $filename}, output_type => "string" })
 
 Does the actual conversion. $filename is the filename to translate (currently
-the only available source). 
+the only available source).
 
-The C<'output_type'> key specifies the return value. A value of C<'string'> returns 
-the XML as a string, and a value of C<'xml'> returns the XML as an 
+The C<'output_type'> key specifies the return value. A value of C<'string'>
+returns the XML as a string, and a value of C<'xml'> returns the XML as an
 L<XML::LibXML> DOM object.
 
 =cut

Text-Qantor/t/02-convert-to-qantor-xml.t

 use strict;
 use warnings;
 
-use Test::More tests => 13;
+use Test::More tests => 15;
 
 use File::Spec;
 
             }
         );
 
-        # TEST
+        # TEST*$num_files
         ok ($fo_converter, "Initialised converter");
 
         my $string;
         {
             open my $got_fo_fh, ">:encoding(utf-8)", $got_fo_file
                 or die "could not open";
-            print {$got_fo_fh} $got_fo_file;
+            print {$got_fo_fh} $string;
             close($got_fo_fh);
         }
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.