File Coverage

blib/lib/Treex/PML/Backend/PMLTransform.pm
Criterion Covered Total %
statement 5 7 71.4
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 8 10 80.0


line stmt bran cond sub pod time code
1             package Treex::PML::Backend::PMLTransform;
2              
3 1     1   813 use vars qw($VERSION);
  1         2  
  1         63  
4             BEGIN {
5 1     1   18 $VERSION='2.22'; # version template
6             }
7              
8 1     1   29 use Treex::PML::Backend::PML qw(open_backend close_backend read write);
  0            
  0            
9              
10             sub test {
11             local $Treex::PML::Backend::PML::TRANSFORM=1;
12             return &Treex::PML::Backend::PML::test;
13             }
14              
15             1;
16              
17             =pod
18              
19             =head1 NAME
20              
21             Treex::PML::Backend::PMLTransform - I/O backend implementing on-the-fly XML to PML conversion
22              
23             =head1 SYNOPSIS
24              
25             use Treex::PML;
26             Treex::PML::AddBackends(qw(PMLTransform))
27              
28             my $document = Treex::PML::Factory->createDocumentFromFile('input.xml');
29             ...
30             $document->save();
31              
32             =head1 DESCRIPTION
33              
34             This module implements a Treex::PML input/output backend which accepts
35             any XML file and attempts to convert it to PML using user-defined
36             transformations (XSLT 1.0, Perl, or external command). See
37             L for details.
38              
39             WARNING: since this backend accepts every XML file, it should be added as
40             the last backend (otherwise other backends working with XML will not
41             be tried).
42              
43             =head2 BUGS
44              
45             If your system uses libxslt version 1.1.27, the XSLT transformation
46             does not work. Upgrade your system.
47              
48             =head1 COPYRIGHT AND LICENSE
49              
50             Copyright (C) 2006-2010 by Petr Pajas
51              
52             This library is free software; you can redistribute it and/or modify
53             it under the same terms as Perl itself, either Perl version 5.8.2 or,
54             at your option, any later version of Perl 5 you may have available.
55              
56             =cut