NodeJS'de SaxonJS
Sep 14 2020
SaxonJS'yi NodeJS uygulamasına aktarırken sorun yaşıyorum.
const saxonJs = require("saxon-js");
console.log(Object.getOwnPropertyNames(saxonJs));
// [ ]
console.log(Object.getOwnPropertyNames(window.SaxonJS));
/**
[
'atom', 'Atomic',
'transform', 'Serializer',
'serialize', 'StringWriter',
'getProcessorInfo', 'getResource',
'setLogLevel', 'getLogLevel',
'setPlatform', 'getPlatform',
'getNavigator', 'timeStamp',
'internalTransform', 'checkOptions',
'makeAtomicValue', 'getItemDetails',
'XdmArray', 'XdmFunction',
'XdmMap', 'U',
'XError', 'XPath',
'XS', 'Developer'
]
*/
const testOutput = saxonJs.transform({
stylesheetFileName: xslt_filepath,
sourceFileName: source_filename,
destination: 'raw',
});
// returns TypeError: saxonJs.transform is not a function
window.SaxonJS.transform({
stylesheetFileName: xslt_filepath,
sourceFileName: inputFiles[j],
destination: 'raw',
});
// XError: Cannot supply stylesheetFileName in browser
TypeError döndürür: saxonJs.transform bir işlev değil
ne oluyor?
Yanıtlar
MichaelKay Sep 14 2020 at 19:48
Deneyin
require('SaxonJS2N.js')
Node.js versiyonu yerine Saxon-JS'nin tarayıcı versiyonunu aldığınızı düşünüyorum.
Gene Simmons, KISS Çizgi Romanlarının Potansiyel Olarak "İnsanlığı Yeniden Yaratabileceğini" Söyledi
Nicole Kidman, Michael Keaton ve Val Kilmer'in Batman Olarak Paylaştığı Bu 1 Çekici Özelliğe Bayıldı
Kevin Jonas'ın Kızı Alena, Doğum Günü Fotoğrafında Büyümüş Görünüyor: '9 Yaşında Gerçek Hissetmiyor'
Charly Reynolds Yakın Zamandaki Vokal Kord Ameliyatını Açıkladı: 'Şarkı Söylemekte Sorun Yaşıyordum'