Commits

Shlomi Fish committed 5514131

Convert ::Fiction to XML::GrammarBase .

  • Participants
  • Parent commits 2a7801a

Comments (0)

Files changed (3)

File perl/modules/XML-Grammar-Fiction/Changes

     * lib/XML/Grammar/FictionBase/XSLT/Converter.pm
         - Refactoring: _data_dir now initialized from default => sub { ... }.
         - Refactoring: _rng now initialized from default => sub { ... }.
+    * Convert to XML::GrammarBase :
+        - lib/XML/Grammar/Fiction/ToHTML.pm
+        - lib/XML/Grammar/Fiction/ToDocBook.pm
 
 0.12.5      Sat 27 Apr 14:25:15 IDT 2013
     * Do not try to compile scripts/bump-version-number.pl .

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/ToDocBook.pm

 
 use MooX 'late';
 
-extends ("XML::Grammar::Fiction::RNG_Renderer");
+use XML::GrammarBase::Role::RelaxNG;
+use XML::GrammarBase::Role::XSLT;
 
-has '+xslt_transform_basename' => (default => "fiction-xml-to-docbook.xslt");
+with ('XML::GrammarBase::Role::RelaxNG');
+with XSLT(output_format => 'docbook');
 
+has '+module_base' => (default => 'XML-Grammar-Fiction');
+has '+rng_schema_basename' => (default => 'fiction-xml.rng');
+
+has '+to_docbook_xslt_transform_basename' =>
+(
+    default => 'fiction-xml-to-docbook.xslt',
+);
 =head1 NAME
 
 XML::Grammar::Fiction::ToDocBook - module that converts the Fiction-XML to
 
 =cut
 
+=head2 perform_xslt_translation
 
+See L<XML::GrammarBase::Role::XSLT> . The output_format is C<'docbook'> .
 
 =head2 translate_to_docbook
 
 {
     my ($self, $args) = @_;
 
-    return $self->perform_translation($args);
+    return $self->perform_xslt_translation({output_format => 'docbook', %{$args}});
 }
 
 1;

File perl/modules/XML-Grammar-Fiction/lib/XML/Grammar/Fiction/ToHTML.pm

 
 use MooX 'late';
 
-extends( 'XML::Grammar::Fiction::RNG_Renderer' );
+use XML::GrammarBase::Role::RelaxNG;
+use XML::GrammarBase::Role::XSLT;
+
+with ('XML::GrammarBase::Role::RelaxNG');
+with XSLT(output_format => 'html');
+
+has '+module_base' => (default => 'XML-Grammar-Fiction');
+has '+rng_schema_basename' => (default => 'fiction-xml.rng');
+
+has '+to_html_xslt_transform_basename' =>
+(
+    default => 'fiction-xml-to-html.xslt',
+);
 
 =head1 NAME
 
 
 =cut
 
-has '+xslt_transform_basename' => (default => "fiction-xml-to-html.xslt", );
+=head2 perform_xslt_translation
+
+See L<XML::GrammarBase::Role::XSLT> . The output_format is C<'html'> .
 
 =head2 translate_to_html
 
 {
     my ($self, $args) = @_;
 
-    return $self->perform_translation($args);
+    return $self->perform_xslt_translation({output_format => 'html', %{$args}});
 }
 
 1;