lib/LaTeXML/Common/XML/XSLT.pm

filter: Statementstmt 77.7% 7 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 83.3% 10 / 12 CC 1 SCAR 0.9
CC
1
Cov
78%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« lib/LaTeXML/Core/Comment.pm ↑ Summary lib/LaTeXML/Common/Model.pm »
1 # /=====================================================================\ #
2 # | LaTeXML::Common::XML::XSLT | #
3 # | wrapper for XML::LibXML | #
4 # |=====================================================================| #
5 # | Part of LaTeXML: | #
6 # | Public domain software, produced as part of work done by the | #
7 # | United States Government & not subject to copyright in the US. | #
8 # |---------------------------------------------------------------------| #
9 # | Bruce Miller <bruce.miller@nist.gov> #_# | #
10 # | http://dlmf.nist.gov/LaTeXML/ (o o) | #
11 # \=========================================================ooo==U==ooo=/ #
12 package LaTeXML::Common::XML::XSLT;
13 33 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 33 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 0 ▶use XML::LibXSLT;
Subroutine BEGIN: called CC=1 SCAR=2.6
16  
17 sub new {
18 my ($class, $stylesheet) = @_;
19 my $xslt = XML::LibXSLT->new();
20 LaTeXML::Common::XML::initialize_catalogs();
21 # LaTeXML::Common::XML::initialize_input_callbacks($xslt,installation_subdir => 'resources/XSLT');
22 # Do we still need this logic, if callbacks work?
23 if (!ref $stylesheet) {
24 $stylesheet = LaTeXML::Common::XML::Parser->new()->parseFile($stylesheet); }
25 # $stylesheet = $xslt->parse_stylesheet_file($stylesheet); }
26 if (ref $stylesheet eq 'XML::LibXML::Document') {
27 $stylesheet = $xslt->parse_stylesheet($stylesheet); }
28 return bless { stylesheet => $stylesheet }, $class; }
29  
30 sub transform {
31 my ($self, $document, %params) = @_;
32 return $$self{stylesheet}->transform($document, %params); }
33  
34 #======================================================================
35 1;
« lib/LaTeXML/Core/Comment.pm ↑ Summary lib/LaTeXML/Common/Model.pm »