Project

Profile

Help

Bug #5374

closed

TransformFromFile fails to create output file

Added by O'Neil Delpratt over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
C++ API
Start date:
2022-03-07
Due date:
% Done:

100%

Estimated time:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Found in version:
11.2
Fixed in version:
11.3
SaxonC Languages:
SaxonC Platforms:
SaxonC Architecture:

Description

Reported by user here: https://stackoverflow.com/questions/71381858/saxonc-ee-11-2-transformfromfile-produces-empty-output/71383253#71383253

The following snippet of C++ code which uses transformFromFile fails to create output file:

SaxonProcessor* processor = new SaxonProcessor(false);
    processor->setcwd( Current Working Directory );
    Xslt30Processor* xslt = processor->newXslt30Processor();

    XdmNode* xmlfile = processor->parseXmlFromFile( Some Xml File );
    XsltExecutable* xslte = xslt->compileFromFile(Some Xsl File);
    xslte->setOutputFile(Output File);

    xslte->transformToFile(xmlfile); 
Actions #1

Updated by O'Neil Delpratt over 2 years ago

Workaround is to use applyTemplatesReturningFile. Alternatively user can use transformToString then save the string result to file.

Actions #2

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from New to In Progress

Bug issue found in the transformToFile method of the class net.sf.saxon.option.cpp.Xslt30Processor. We fail to correctly execute the transform if the supplied source is an XdmNode value as opposed to a file source.

Actions #3

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 100

Bug fixed and unit test added in C++ tests.

Actions #4

Updated by O'Neil Delpratt over 2 years ago

I confirm the the test case succeeds after bug fix applied.

Actions #5

Updated by O'Neil Delpratt over 2 years ago

  • Status changed from Resolved to Closed
  • Fixed in version set to 11.3

Bug fix applied in the SaxonC 11.3 maintenance release.

Please register to edit this issue

Also available in: Atom PDF