Bug #5493
closedProblems with transform result output.resultDocuments
100%
Description
As raised by Martin in the forum (see resultDocuments
property is not being populated as intended when deliverResultDocument
requests the destination
to be serialized
.
There is some confusion in the documentation as to whether the transform options properties destination
and resultForm
affect secondary result documents, or just the principal result document. The destination
info at https://www.saxonica.com/saxon-js/documentation2/index.html#!api/transform says it "Determines what happens to the principal result tree from the transformation" and does not mention secondary results (except for updating the HTML page in the browser); and it is clear that deliverResultDocument
determines what happens to secondary results, with its own destination
defined in the function return object. However https://www.saxonica.com/saxon-js/documentation2/index.html#!api/transform/results says:
As with the principal result document, the way in which secondary result documents are returned is determined by the options supplied to the transformation, in particular options.destination and options.resultForm
I think this statement is wrong for destination
, I'm not sure about resultForm
.
So when deliverResultDocument
is not supplied, I don't think options.destination
has any influence for the secondary results, and the default action in Node.js is to write to file. See the documentation for deliverResultDocument
:
In the absence of the
deliverResultDocument
option, SaxonJS effectively uses a default in which:
destination
is "html-page" if running in the browser, or "file" in Node.js;save
places the value inoutput.resultDocuments[URI]
, unlessdestination="file"
, in which case the value is written to filestore.
But it should be possible to supply a function for deliverResultDocument
which returns an object with "destination" : "serialized"
, and no save
property; to request that the secondary result documents should populate output.resultDocuments
(by the default save
function); but this currently fails.
Please register to edit this issue
Also available in: Atom PDF Tracking page