xslt3-he
Version:
SaxonJS XSLT 3.0 processor: command line interface to SaxonJS
87 lines (85 loc) • 41.1 kB
JavaScript
#!/usr/bin/env node
(function(){var CommandLine$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$commandLineOptions=function(){function a(e,d="HE"){e.addRecognizedOption("co",b.TYPE_ENUMERATION|b.VALUE_REQUIRED,"Set compiler option");e.setPermittedValues("co","justStatic justNormalize noXPath noBindings timing traceProgress enableAssertions internalCompile".split(" "),null);e.addRecognizedOption("tp",b.TYPE_BOOLEAN,"Trace compiler progress");e.addRecognizedOption("export",b.TYPE_FILENAME|b.VALUE_REQUIRED,
"Export the compiled stylesheet");e.addRecognizedOption("im",b.TYPE_QNAME|b.VALUE_REQUIRED,"Name of initial mode");e.addRecognizedOption("it",b.TYPE_QNAME,"Name of initial template");e.setPermittedValues("it",[],"Q{http://www.w3.org/1999/XSL/Transform}initial-template");e.addRecognizedOption("json",b.TYPE_FILENAME|b.VALUE_REQUIRED,"Source file for primary JSON input");e.addRecognizedOption("master",b.TYPE_FILENAME|b.VALUE_REQUIRED,"Master document for in-situ update");e.addRecognizedOption("nogo",
b.TYPE_BOOLEAN,"Compile only, no evaluation");e.addRecognizedOption("ns",b.TYPE_ENUMERATION|b.VALUE_REQUIRED,"Default namespace for element names");e.setPermittedValues("ns",["##html5"],null);e.addRecognizedOption("o",b.TYPE_FILENAME|b.VALUE_REQUIRED,"Destination file for primary output");e.addRecognizedOption("relocate",b.TYPE_BOOLEAN,"Produce relocatable packages");e.addRecognizedOption("s",b.TYPE_FILENAME|b.VALUE_REQUIRED,"Source file for primary XML input");e.addRecognizedOption("t",b.TYPE_BOOLEAN,
"Display version and timing information, and names of output files");e.addRecognizedOption("xp",b.TYPE_STRING,"XPath expression");e.addRecognizedOption("xsl",b.TYPE_FILENAME,"Main stylesheet file (XSLT or SEF)");e.addRecognizedOption("?",b.TYPE_BOOLEAN|b.VALUE_PROHIBITED,"Display command line help text");"EE"===d&&(e.addRecognizedOption("debug",b.TYPE_BOOLEAN,"Use diagnostic version of SaxonJS"),e.addRecognizedOption("T",b.TYPE_ENUMERATION,"Trace execution"),e.setPermittedValues("T",["none","low",
"normal","high"],"low"),e.addRecognizedOption("TP",b.TYPE_FILENAME|b.VALUE_REQUIRED,"Write timing profile to specified output file"));e.addRecognizedOption("stublib",b.TYPE_FILENAME|b.VALUE_REQUIRED,"External functions stub library")}const b={TYPE_BOOLEAN:1,TYPE_FILENAME:2,TYPE_ENUMERATION:4,TYPE_INTEGER:5,TYPE_QNAME:6,TYPE_FILENAME_LIST:7,TYPE_DATETIME:8,TYPE_STRING:9,TYPE_INTEGER_PAIR:10,VALUE_REQUIRED:256,VALUE_PROHIBITED:512},c=["on","yes","true","1"],h=["off","no","false","0"];let f={TYPE_BOOLEAN:c.concat(h).join("|"),
TYPE_FILENAME:"file name",TYPE_ENUMERATION:4,TYPE_INTEGER:"integer",TYPE_QNAME:"QName in URI qualified name form (Q{uri}local)",TYPE_FILENAME_LIST:"list of file names, semicolon-separated",TYPE_DATETIME:"dateTime in ??? format",TYPE_STRING:"string",TYPE_INTEGER_PAIR:"int,int"};for(let e in b)f[b[e]]=f[e];class g{constructor(){this._recognized={};this.actualOptions={};this.extraOptions={}}addRecognizedOption(e,d,l){this._recognized[e]={type:d&255,required:d&768,help:l}}setPermittedValues(e,d,l){let r=
this._recognized[e];r?(r.values=d,r.defaultValue=l):console.log("setPermittedValues - no record yet for option:",e)}displayPermittedOptions(){let e=[];for(let d in this._recognized)e.push(d);e.sort((d,l)=>{d=d.toLowerCase();l=l.toLowerCase();return d<l?-1:d===l?0:1});e=e.map(d=>" -"+d);return e.join()}setActualOptions(e){function d(m,k){throw Error("Command line option -"+m+" "+k);}const l=this._recognized;let r=this.actualOptions,v=this.extraOptions;e.filter(m=>m.startsWith("-")).forEach(function(m){var k=
m.indexOf(":"),p=0>k?m.substring(1):m.substring(1,k);k=0>k?"":m.substring(k+1);if(m.startsWith("--"))v[p.substring(1)]=k;else{(m=l[p])||d(p,"is not recognized");if("?"===k)throw p="Help for -"+p+" option:\nValue: "+(4==m.type?m.values.join("|"):f[m.type]),p+="\nMeaning: "+m.help,Error(p+"\n\nNo processing requested");256===m.required&&""===k&&d(p,"requires a value");512===m.required&&""!==k&&d(p,"must not have a value");""===k&&(k=m.defaultValue||"");switch(m.type){case 4:k&&-1===m.values.indexOf(k)&&
d(p,"may only have values "+m.values.join("|"));break;case 5:/[0-9]+/.test(k)||d(p,"may only have value "+f.TYPE_INTEGER);k=parseInt(k,10);break;case 1:0<=c.indexOf(k)?k=!0:0<=h.indexOf(k)?k=!1:""===k?k=!0:d(p,"may only have a boolean value "+f.TYPE_BOOLEAN);break;case 6:/{/.test(k)||/}/.test(k)||(k="Q{}"+k),/^Q{[^{}]*}[^{}]+$/.test(k)||d(p,"may only have value "+f.TYPE_QNAME)}r[p]=k}})}}return{OptionTypes:b,newCLOptions:function(e="HE"){let d=new g;a(d,e);return d}}}(),module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$commandLineOptions=
{};module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$commandLineOptions.CommandLine=CommandLine$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$commandLineOptions;let errorCount$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror=0;
class XError$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror extends Error{constructor(a="SaxonJS run-time error",b="FORG0001",c=null){super();this.name="XError";this.message=a;this.code=b;c?this.setExpr(c):this.xsltModule=this.xsltLineNr=null;this.jsStack=Error().stack;this.errorObject=null;this.isGlobal=!1;this.context=null;errorCount$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror++}toString(){return this.name+":"+
this.message+"; code:"+this.code}setExpr(a){function b(c,h){for(;c;){if(c[h])return c[h];c=c.parentNode}return null}this.xsltLineNr=b(a,"line");this.xsltModule=b(a,"module")}getStackTrace(){return typeof this.context?this.context.getStackTrace():""}getMessage(){let a="Error "+this.code;null!=this.xsltLineNr&&(a+=" at "+this.xsltModule+"#"+this.xsltLineNr);return a+="\n "+this.message}getRawMessage(){return this.message}getErrorCode(){return this.code}getOriginatingModule(){return this.xsltModule}getOriginatingLineNr(){return this.xsltLineNr}static errorCount(){return errorCount$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror}static resetErrorCount(){errorCount$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror=
0}}var module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror={};module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror.XError=XError$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror;const SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum=String.fromCharCode(931),SIGMA2$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum=SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum+"2";
class Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum{constructor(){}static checksumProperty(){return SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum}static hashProperty(){return SIGMA2$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum}static checksum(a){function b(e,d){d<<=8;for(let l=0;l<e.length;l++)d=(d<<1)+e.charCodeAt(l);return d}function c(e,d,
l){return b(e,l)^b(d,l)}function h(e){f^=c(e.N,"http://ns.saxonica.com/xslt/export",g++);for(let d in e)!e.hasOwnProperty(d)||"N"===d||"C"===d||"ELAB"===d||"PUSH"===d||"parentNode"===d||"catch"===e.N&&"test"===d||d===SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum||d===SIGMA2$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum||(f^=c(d,"",g),f^=b(e[d],g));e.C&&e.C.forEach(function(d){h(d)});f^=1}let f=0,g=
0;h(a);return f}static assignChecksum(a){const b=Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.checksum(a);a[SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum]=(0>b?4294967295+b+1:b).toString(16)}static verifyChecksum(a){const b=a[SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum]||"unspecified";if("unspecified"===b)throw new XError$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror("No checksum found in SEF",
"SXJS0006");a=Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.checksum(a);if((0>a?4294967295+a+1:a).toString(16)!==b)throw new XError$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror("Invalid checksum in SEF: "+b,"SXJS0006");}static collectHashData(a){function b(g,e,d){h+=d.toString();h+=g;h+=d.toString();h+=e;return 0}function c(g){b(g.N,"http://ns.saxonica.com/xslt/export",f++);let e=[];for(let d in g)!g.hasOwnProperty(d)||
"N"===d||"C"===d||"ELAB"===d||"PUSH"===d||"parentNode"===d||"catch"===g.N&&"test"===d||d===SIGMA$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum||d===SIGMA2$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum||"PRIMED"===d||e.push(d);e.sort();e.forEach(d=>{b(d,"",f);d=g[d];h+=f.toString();h+=d});g.C&&g.C.forEach(function(d){c(d)})}let h="",f=0;c(a);return h}static hash(a,b){b=Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.collectHashData(b);
a=a.crypto(b);return Array.from(new Uint8Array(a)).map(c=>c.toString(16).padStart(2,"0")).join("")}static assignHash(a,b){b[SIGMA2$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum]=Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.hash(a,b)}static verifyHash(a,b){const c=b[SIGMA2$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum]||"unspecified";if("unspecified"===
c)console.log("No hash found in SEF","SXJS0006");else if(Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.hash(a,b)!==c)throw new XError$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$xerror("Invalid hash in SEF: "+c,"SXJS0006");}}var module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum={};
module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.Checksum=Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum;const argv$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=process.argv;let finished$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=!1,exitCode$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=0,failed$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=!1,profiler$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command;
function exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a=0){finished$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=!0;a>exitCode$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command&&(exitCode$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=a,process.exitCode=a)}
function quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b=0){console.error(a);failed$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=!0;exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(b)}
function log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.saxonPrint(a)}function warn$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("*Warning*: "+a)}
function staticExceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){return a instanceof SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XError?"Error "+a.code.replace(/^Q\{http:\/\/www.w3.org\/2005\/xqt-errors\}/,"")+(a.errorObject?a.errorObject.toString():"")+":\n "+a.message:a.hasOwnProperty("message")?a.message:a.toString()}
function exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){return a instanceof SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XError?a.getMessage():a.hasOwnProperty("message")?a.message:a.toString()}
function hasArg$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){return argv$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.includes(a)}const fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=require("fs"),{URL:URL$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command}=require("url");
let extensions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command={getTraceCodeInjector:function(){return null},getProfiler:function(){return null},registerExtensions:function(){}};"undefined"!==typeof Extensions&&(extensions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=Extensions);let RenderProfileSEF$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command={};
"undefined"!==typeof RenderProfile&&(RenderProfileSEF$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=RenderProfile.sef);let edition$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command={getSaxonEdition:function(){return"HE"}};"undefined"!==typeof Edition&&(edition$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=Edition);
let SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=null;
if("EE"===edition$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.getSaxonEdition())try{SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=require(hasArg$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("-debug")?"saxonjs-ee/debug":"saxonjs-ee")}catch(a){a.message&&0<=a.message.indexOf("license is required")?console.log(`Error: ${a.message}`):(console.log(`SaxonJS require failed: ${hasArg$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("-debug")?
"saxonjs-ee/debug":"saxonjs-ee.js"}`),a.message?console.log(a.message):console.log(a)),SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=null,exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(2)}else SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=require("saxonjs-he");
const platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=null===SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command?null:SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.internals.getPlatform();
function getParamsMap$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){const b={};a.filter(c=>!/^[-!]/.test(c)).forEach(function(c){const h=c.split("=");let [f,g]=h;1===h.length&&quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Missing '=' in parameter '"+c+"'",2);switch(f.charAt(0)){case "?":f=f.slice(1);try{g=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XPath.evaluate(g,
null,{resultForm:"xdm"})}catch(e){throw e;}break;case "+":f=f.slice(1),g=getPathToFileSync$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g),fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.statSync(g).isDirectory()?quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g+" is a directory",2):g=[getXML$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g)]}/{/.test(f)||
/}/.test(f)||(f="Q{}"+f);/^Q{[^{}]*}[^{}]+$/.test(f)||quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Invalid parameter key "+f,2);b[f]=g});return b}
function getXdmParams$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){const b=new SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XdmMap;for(const c in a){let h=a[c];Array.isArray(h)||(h=[SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XS.untypedAtomic.fromString(h)]);b.inSituPut(SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XS.QName.fromEQName(c),
h)}return b}function getSerializationParams$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){const b={};a.filter(c=>c.startsWith("!")).forEach(function(c){c=c.split(/=/);let [h,f]=c;h=h.slice(1).replace(/^saxon:/,"Q{http://saxon.sf.net/}");b[h]=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.internals.Serializer.validateParam(h,f)});return b}
function addParentPointers$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){a.C&&a.C.forEach(function(b){b.parentNode=a;addParentPointers$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(b)})}function TransformOptions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(){}
TransformOptions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.prototype={stylesheetParams:{},templateParams:{},tunnelParams:{},functionParams:{},deliverResultDocument:void 0,stylesheetText:""};
function invokeSEFTransform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b,c){c.async=!0;const h=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.internals.checkOptions(c);return b?SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.getResource({file:b,type:"xml"}).catch(f=>Promise.reject(f)).then(f=>{SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.internals.internalTransform(a,
f,h);return h.resultPromise}):Promise.reject(Error("Source filename missing"))}
function compileXSLT$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b,c){let h=new TransformOptions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command;h.destination="application";h.initialMode="compile-complete";h.templateParams={"Q{}options":{noXPath:!1}};for(let f in b)b.hasOwnProperty(f)&&(h.templateParams["Q{}options"][f]=b[f]);b=new SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XdmMap;
b.inSituPut(SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XS.QName.fromParts("","","staticParameters"),[c]);h.stylesheetParams=b;c=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.resource("compiler");addParentPointers$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c);h.stylesheetInternal=c;return invokeSEFTransform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c,
a,h).then(f=>f.principalResult)}
function getXML$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){const b=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.parseXmlFromString(readFile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a));b._saxonBaseUri=filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a);return b}
function readFile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){try{return fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.readFileSync(a,"utf8")}catch(b){quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Unable to read "+a,2)}}
function getPathToFileSync$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){return fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.realpathSync(a)}function getPathToFile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){return fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.promises.realpath(a)}
function filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){return platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.fileURL(a)}
function compile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b,c,h,f){return getPathToFile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a.xsl).catch(g=>{g=g.message.replace("ENOENT: no such file or directory, realpath ","");return Promise.reject(new SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XError("Cannot locate stylesheet ("+g+")"))}).then(g=>
{if(g.endsWith(".sef")||g.endsWith(".sef.json"))return c.stylesheetFileName=g,c;if(g.endsWith(".sef.xml")){let e,d=getXML$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g);try{e=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.internals.XPath.sefToJSON(d.firstChild,!1)}catch(l){return Promise.reject(Error("Internal error: the intermediate XML form of the SEF file is invalid: "+l.message))}Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.assignChecksum(e);
Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.assignHash(platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command,e);c.stylesheetText=JSON.stringify(e);return c}a.t&&console.error("Compiling stylesheet "+g);return compileXSLT$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g,b,h).catch(e=>{console.error(staticExceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(e));
return Promise.reject(Error("Failed to compile stylesheet"))}).then(e=>{Array.isArray(e)&&(e=e[0]);let d;try{d=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.internals.XPath.sefToJSON(e.firstChild,!1)}catch(l){return Promise.reject(Error("Internal error: the intermediate XML form of the SEF file is invalid: "+l.message))}Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.assignChecksum(d);Checksum$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$src$Checksum.assignHash(platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command,
d);c.stylesheetText=JSON.stringify(d);c.stylesheetBaseURI=filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g);return c})})}
function executeTransformation$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b,c){const h=process.hrtime();if(a.o){var f=a.o;try{fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.realpathSync(f)}catch(g){platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.writeFileSync(new URL$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(f)),"")}b.baseOutputURI=
filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(f);b.destination="file"}else b.destination="stdout",b.baseOutputURI=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.baseURL();c&&(b.logLevel=2);a.T&&(b.traceInjector=extensions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.getTraceCodeInjector(SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command,
a.T));a.TP&&(profiler$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command=extensions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.getProfiler(SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command),b.traceInjector=profiler$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.injector);a.s&&(f=a.s,/^(http:|https:|file:)/.test(f)?
b.sourceLocation=f:b.sourceFileName=filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(f).toString());a.json&&(a.s&&quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Cannot supply both -s and -json",2),f=a.json,/^(http:|https:|file:)/.test(f)?b.sourceLocation=f:b.sourceFileName=filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(f).toString(),
b.sourceType="json");a.it&&(c&&log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Initial template: "+a.it),b.initialTemplate=a.it);a.im&&(c&&log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Initial mode: "+a.im),b.initialMode=a.im);c&&a.o&&log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Writing to "+filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a.o));
return SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.transform(b,"async").then(()=>{if(c){var g=process.hrtime(h);console.warn("\nExecution time: %d.%ds",g[0],Math.floor(g[1]/1E6));g=process.memoryUsage().heapUsed/1024/1024;console.warn(`Memory used: ${Math.round(100*g)/100}Mb`)}})}
function main$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(){var a=argv$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.slice(2);let b=CommandLine$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$commandLineOptions.newCLOptions(edition$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.getSaxonEdition());try{b.setActualOptions(a)}catch(g){quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g),
2)}if(!finished$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command&&!failed$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command){var c=b.actualOptions,h=b.extraOptions,f=new TransformOptions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command;a.forEach(g=>{finished$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command||/[=-]/g.test(g)||
badUsage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Invalid command line input: "+g)});if(!finished$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command)try{const g=getParamsMap$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a),e=getSerializationParams$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a);if(c["?"])badUsage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("");
else{const d=c.t,l=c.ns,r=c.relocate,v=c.tp,m=c.co;if(d){const k=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.getProcessorInfo();log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(k.productName+" "+k.productVersion+" from Saxonica ");log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Node.js version "+process.version)}if(c.xsl||c.xp){extensions$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.registerExtensions(SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command);
if("stublib"in c){const k=c.stublib,p=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.readFile(k);let q=JSON.parse(p);Array.isArray(q)||(q=[q]);for(const n of q){if(!("namespace"in n))throw Error(`External functions must have a namespace: ${k}`);if(!("signatures"in n))throw Error(`External functions must have signatures: ${k}`);for(let t in n.signatures){let u=n.signatures[t];if(!("as"in u&&"param"in u&&"arity"in u))throw Error(`Invalid signature for ${t} in ${k}: ${u}`);
}SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.registerExtensionFunctions(n)}}if(c.xsl){const k=getXdmParams$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g);a={traceProgress:!!v,timing:!!d};a.extraOptions=h;a.relocatable=!!r;l&&(a.ns=l);m&&(a[m]=!0);let p=compile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c,a,f,k,e);c["export"]&&(p=p.then(n=>
platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.writeFileAsync(new URL$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c["export"])),n.stylesheetText,"utf8")).then(()=>getPathToFile$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c["export"]).then(n=>
{d&&log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Stylesheet exported to SEF file "+n)})));let q=p.then(()=>{c.nogo&&exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command()});if(!c.nogo){if(c.master)try{const n=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.readFile(c.master),t=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.parseXmlFromString(n);
f.masterDocument=t}catch(n){return log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Failed while reading and parsing master document "+c.master),Promise.reject(n)}q=q.then(()=>{f.stylesheetParams=k;f.outputProperties=e;f.extraOptions=h;return executeTransformation$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c,f,d)}).then(()=>{d&&!failed$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command&&
log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Transformation complete ")})}q=q.catch(n=>quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(n),2));f.masterDocument&&(q=q.then(()=>{if(failed$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command)return Promise.reject("Transformation failed");
const n=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.serialize(f.masterDocument,{method:"xml"});return fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.promises.writeFile(c.master,n)}));c.TP&&(q=q.then(()=>{const n=c.TP,t=profiler$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.report();return SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.transform({stylesheetText:JSON.stringify(RenderProfileSEF$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command),
stylesheetParams:{"Q{}metrics":JSON.stringify(t)},destination:"file",baseOutputURI:filepathToUri$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(n),outputProps:{method:"html",indent:!0}},"async").catch(u=>Promise.reject(u))}).catch(n=>Promise.reject(n)));q.finally(()=>{exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command()}).catch(n=>{quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(n),
1)})}else executeXPath$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(c,g,e),exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command()}else quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Saxon requires a stylesheet as -xsl: argument",2)}}catch(g){quit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g),
2)}}}
function executeXPath$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b,c){if("s"in a||"json"in a){const h=a.s||a.json;let f={};/^(http:|https:|file:)/.test(h)?f.location=h:f.file=h;platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.resourcePromise(f).then(g=>{g="s"in a?platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.parseXmlFromString(g):platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.parseJsonFromString(g);
executeXPathOverData$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g,a,b,c)}).catch(g=>{console.error(exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(g));exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(1)})}else try{executeXPathOverData$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(null,
a,b,c)}catch(h){console.error(exceptionMessage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(h)),exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(1)}}
function executeXPathOverData$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a,b,c,h){const f=platform$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.baseURL();a=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.XPath.evaluate(b.xp,a,{resultForm:"xdm",params:c,staticBaseURI:f});c={method:"adaptive"};for(const g in h)c[g]=h[g];h=SaxonJS$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.serialize(a,
c);"o"in b?(b=fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.openSync(b.o,"w"),fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.writeSync(b,h,0,"utf-8"),fs$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command.closeSync(b)):process.stdout.write(h)}
function badUsage$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(a){""!==a&&console.error(a);log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Usage: see https://www.saxonica.com/saxonjs/documentation3/index.html#!nodejs/command-line");let b=CommandLine$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$commandLineOptions.newCLOptions();log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Options available:"+
b.displayPermittedOptions());log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Use -XYZ:? for details of option XYZ");log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command("Params: ");log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(" param=value Set stylesheet string parameter");log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(" +param=filename Set stylesheet document parameter");
log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(" ?param=expression Set stylesheet parameter using XPath");log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(" !param=value Set serialization parameter");log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(" (bindings and values containing punctuation may need to be quoted in some command shells,");
log$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(' e.g. in PowerShell: "{NS}key=val" ?range="1 to 20" )');""===a?exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command():exit$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command(2)}main$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command();
(function wait(){finished$$module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command||setTimeout(wait,100)})();var module$Volumes$Saxonica$src$saxonica$saxon_js_enterprise$build$prepare$nodeCLI$nodeJS$command={};}).call(this);