Project

Profile

Help

XSLT 2.0 transformation hangs with Saxon/C 1.2.1

Added by Ulrich Belz over 3 years ago

I am using Saxon/C for XSLT 2.0 transformation with php on a Web server. Unfortunately it is crashing / hangs in compileFromFile:

  public static function saxonTransform($xmlDocument, $parameters, $xslFilename) {
 
    $proc = new Saxon\SaxonProcessor();
    $version = $proc->version(); // returns Saxon/C 1.2.1 running with Saxon-HE 9.9.1.5C from Saxonica
    $xsltProc = $proc->newXsltProcessor();
    // $xsltProc->setSourceFromXdmValue($xmlDocument);
    $xmlDocument->save("xmlString.xml");
    $xsltProc->setSourceFromFile("xmlString.xml");
    $xsltProc->compileFromFile($xslFilename); // this crashes / hangs
...  

I am using the Linux binary from the C/C++, PHP and Python Downloads page.

What can I do?


Replies (4)

Please register to reply

RE: XSLT 2.0 transformation hangs with Saxon/C 1.2.1 - Added by O'Neil Delpratt over 3 years ago

Hi,

The cause of this hanging is probably due to this bug: https://saxonica.plan.io/issues/4371

The workaround is to replace the php7_saxon.cpp given in the same bug issue and rebuild the extension again.

RE: XSLT 2.0 transformation hangs with Saxon/C 1.2.1 - Added by Ulrich Belz over 3 years ago

Hello,

Indeed. After patching and rebuilding it works fine. Thank you so much.

Please allow one additional question: Is it possible to use a DOMDocument as source, or do I have to go through a file or string/XdmValue?

RE: XSLT 2.0 transformation hangs with Saxon/C 1.2.1 - Added by O'Neil Delpratt over 3 years ago

The DOMDocument source is not supported with Saxon/C. Option currently available are file, string or XdmValue

    (1-4/4)

    Please register to reply