'SaxonC EE 11.2 "TransformFromFile()" produces empty output
my C++ code :
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);
This works when i use "Xslt30Processor::TransformFiletoFile()" but this somehow doesn't.
Solution 1:[1]
I will raise a bug issue against transformToFile(). However if you use applyTemplatesReturningFile as a workaround it does work:
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->setInitialMatchSelection(xmlfile);
xslte->applyTemplatesReturningFile(Output File);
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
