Project

Profile

Help

Bug #6132 » testDocumentPool1.js

direct use of documentPool with SaxonJS.transform works - Martin Honnen, 2023-07-18 18:51

 
const path = require('path');

const url = require('url');



const SaxonJS = require('saxon-js');

var xmlResource1 = SaxonJS.getResource({'type': 'xml', 'text' : '<root>foo</root>' });

var doc1Uri = 'doc1.xml';

var docPool = {};

xmlResource1.then(doc => { docPool[url.pathToFileURL(path.resolve('.', doc1Uri))] = doc; })
.then(() => {
//console.log(docPool);
SaxonJS.transform({ documentPool: docPool, stylesheetLocation: 'documentPoolTest1.xsl.sef.json' }, 'async').then(result => {
console.log(SaxonJS.serialize(result.principalResult));
});
});

(5-5/6)