[xslt] Seg fault handling multiple transformations with XML::LibXSLT

Hash: SHA1

I'm using Matt Sergeant's excellent XML::LibXML and XML::LibXSLT Perl 
interfaces to libxml and libxslt.  I've encountered a somewhat bizarre 
situation that leads to a segmentation fault.

I'm using:
    Windows NT 4.0 SP 6a
    Cygwin 1.3.9(0.51/3/2)
    libxml 20413
    libxslt 10010
    libexslt 703
    Perl 5.6.1
    XML::LibXML 1.31
    XML::LibXSLT 1.31

I instantiate a single XML parser and a single XSLT engine:

     $parser = XML::LibXML->new();
     $xslt = XML::LibXSLT->new();

and parse the stylesheet once:

         $stylesheet = $xslt->
             parse_stylesheet_file( $Config::SPLIT_TRANSFORM );

Then, in a foreach loop, I parse an XML string and transform it:

         $xmlsource = $parser->parse_string( $xmlstring );
         $result = $stylesheet->transform( $xmlsource, %xsltparams );

Now, here's the fun part.  I'm testing this with two input files and two 
stylesheets.  If I only handle one file at a time, no problem.  If I use 
the one-page stylesheet, no problem.  If I use the split stylesheet (which 
uses xsl:document) and handle the files in reverse order, no problem.  But 
if I handle the files in the default order, with the split stylesheet, and 
both in one pass, I get a segmentation fault.


My guess is that there's some data structure in the stylesheet object 
that's getting put in a weird state by the first file and then breaks when 
accessed by the second file, or something like that.  But I really have no 
idea where to begin looking.  I've tried to create a reproduction case, but 
I haven't been able to so far.

Pointers are gladly welcomed.

Thanks in advance,
- -- 
Christopher R. Maden, Principal Consultant, crism consulting
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA
Version: PGP Personal Privacy 6.5.8


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]