3 SELECT evergreen.upgrade_deps_block_check('1030', :eg_version);
5 CREATE OR REPLACE FUNCTION evergreen.oils_xslt_process(TEXT, TEXT) RETURNS TEXT AS $func$
14 # The following approach uses the older XML::LibXML 1.69 / XML::LibXSLT 1.68
15 # methods of parsing XML documents and stylesheets, in the hopes of broader
16 # compatibility with distributions
17 my $parser = $_SHARED{'_xslt_process'}{parsers}{xml} || XML::LibXML->new();
19 # Cache the XML parser, if we do not already have one
20 $_SHARED{'_xslt_process'}{parsers}{xml} = $parser
21 unless ($_SHARED{'_xslt_process'}{parsers}{xml});
23 my $xslt_parser = $_SHARED{'_xslt_process'}{parsers}{xslt} || XML::LibXSLT->new();
25 # Cache the XSLT processor, if we do not already have one
26 $_SHARED{'_xslt_process'}{parsers}{xslt} = $xslt_parser
27 unless ($_SHARED{'_xslt_process'}{parsers}{xslt});
29 my $stylesheet = $_SHARED{'_xslt_process'}{stylesheets}{$xslt} ||
30 $xslt_parser->parse_stylesheet( $parser->parse_string($xslt) );
32 $_SHARED{'_xslt_process'}{stylesheets}{$xslt} = $stylesheet
33 unless ($_SHARED{'_xslt_process'}{stylesheets}{$xslt});
35 return $stylesheet->output_as_chars(
36 $stylesheet->transform(
37 $parser->parse_string($doc)
41 $func$ LANGUAGE 'plperlu' STRICT IMMUTABLE;