Skip to content

Commit

Permalink
Issue #88: tell XML::Simple to use XML::LibXML::SAX::Parser
Browse files Browse the repository at this point in the history
Set up the XML parser explicitly because XML::SAX::Expat would
be used per default. But the goal is to consolidate to XML::LibXML.
  • Loading branch information
bschmalhofer committed Mar 1, 2023
1 parent c117dfa commit a77f27f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Kernel/GenericInterface/Mapping/XSLT.pm
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ sub Map {
# http://stackoverflow.com/questions/12182129/convert-string-to-hash-using-libxml-in-perl
$Kernel::OM->Get('Kernel::System::Main')->Require('XML::Simple');

# Set the preferred parser for XML::Simple.
# Override the default XML::Sax::Expat which is based on XML::Parser, which is based on expat.
# Override potential settings in $ENV{XML_SIMPLE_PREFERRED_PARSER}.
local $XML::Simple::PREFERRED_PARSER = 'XML::LibXML::SAX::Parser';

my $XMLSimple = XML::Simple->new;
my $XMLPre = eval {
$XMLSimple->XMLout(
Expand Down

0 comments on commit a77f27f

Please sign in to comment.