Saxonica Developer Community: Issueshttps://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2024-02-20T15:42:25ZSaxonica Developer Community
Planio SaxonJS - Feature #6355 (New): A new instruction that makes a document available by the document(...https://saxonica.plan.io/issues/63552024-02-20T15:42:25ZMartynas Jusevicius
<p><code>ixsl:schedule-action</code> supports <code>@document</code> and <code>@http-request</code>. Both approaches have their advantages.
For <code>@schedule-action</code>:</p>
<blockquote>
<p>The called template can access the documents using the <code>doc()</code>, <code>document()</code>, <code>doc-available()</code>, <code>json-doc()</code>, <code>unparsed-text()</code>, <code>unparsed-text-available()</code>, and <code>unparsed-text-lines()</code> functions as appropriate (the documents will be found in a local cache and will not involve another request to the server).</p>
</blockquote>
<p>For <code>@http-request</code> it's the possibility to fully specify the HTTP request headers. That's what I have been using so har</p>
<p>The problem is that the approaches cannot be combined. In other words, it is not possible to specify HTTP request headers, load documents asynchronously <em>and</em> pass them to templates that use document()
What could be the solution to this?</p>
<p>Adding more options to <code>ixsl:schedule-action</code> seems like it would overload the instruction too much. I'm thinking a better idea could be decoupling the HTTP client functionality from the document caching functionality. That could be achieved using a new instruction that caches a document node under the specified URI, thus making it available for <code>document()</code> calls.</p>
<p>For example:</p>
<pre><code class="xml syntaxhl" data-language="xml"> <span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"href"</span> <span class="na">select=</span><span class="s">"http://example.com/doc.xml"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><ixsl:schedule-action</span> <span class="na">http-request=</span><span class="s">"map{ 'href': $href }"</span><span class="nt">></span>
<span class="nt"><xsl:call-template</span> <span class="na">name=</span><span class="s">"response-callback"</span><span class="nt">></span>
<span class="nt"><xsl:with-param</span> <span class="na">name=</span><span class="s">"href"</span> <span class="na">select=</span><span class="s">"$href"</span><span class="nt">/></span>
<span class="nt"></xsl:call-template></span>
<span class="nt"></ixsk:schedule-action></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"response-callback"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"href"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><ixsl:cache-doc</span> <span class="na">href=</span><span class="s">"$href"</span> <span class="na">select=</span><span class="s">"?body"</span><span class="nt">/></span>
<span class="nt"><xsl:call-template</span> <span class="na">name=</span><span class="s">"legacy"</span><span class="nt">/></span>
<span class="nt"></xsl:template></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"legacy"</span><span class="nt">></span>
<span class="nt"><xsl:message</span> <span class="na">select=</span><span class="s">"document('http://example.com/doc.xml')"</span><span class="nt">/></span> <span class="c"><!-- retrieved from cache --></span>
<span class="nt"></xsl:template></span>
</code></pre> SaxonJS - Feature #6303 (New): `xsl:result-document` method that replaces `outerHTML`https://saxonica.plan.io/issues/63032023-12-22T10:53:55ZMartynas Jusevicius
<p>Currently <code><xsl:result-document method="ixsl:replace-content"></code> replaces the equivalent of <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML" class="external"><code>innerHTML</code></a>.</p>
<p>Therefore I often find myself doing stuff like this:</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"row"</span> <span class="na">as=</span><span class="s">"node()*"</span><span class="nt">></span>
<span class="nt"><xsl:apply-templates</span> <span class="na">select=</span><span class="s">"$resource"</span> <span class="na">mode=</span><span class="s">"bs2:Row"</span><span class="nt">/></span>
<span class="nt"></xsl:variable></span>
<span class="nt"><xsl:result-document</span> <span class="na">href=</span><span class="s">"?."</span> <span class="na">method=</span><span class="s">"ixsl:replace-content"</span><span class="nt">></span>
<span class="nt"><xsl:copy-of</span> <span class="na">select=</span><span class="s">"$row/*"</span><span class="nt">/></span>
<span class="nt"></xsl:result-document></span>
</code></pre>
<p>Whereas it would be much more convenient to have a new method such as <code>ixsl:replace-self</code> that would replace <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/outerHTML" class="external"><code>outerHTML</code></a>. My example would look much simpler then:</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="nt"><xsl:result-document</span> <span class="na">href=</span><span class="s">"?."</span> <span class="na">method=</span><span class="s">"ixsl:replace-self"</span><span class="nt">></span>
<span class="nt"><xsl:apply-templates</span> <span class="na">select=</span><span class="s">"$resource"</span> <span class="na">mode=</span><span class="s">"bs2:Row"</span><span class="nt">/></span>
<span class="nt"></xsl:result-document></span>
</code></pre> SaxonJS - Bug #6298 (New): base-uri() value does not update together with DOMhttps://saxonica.plan.io/issues/62982023-12-19T23:34:51ZMartynas Jusevicius
<p>My SaxonJS code replaces large chunks of DOM with content loaded from different documents. DOM's baseURI property returns the source document's URL, but <code>base-uri()</code> does not always seem to do that. Which can lead to a stale value, probably because the DOM is updated?</p>
<p>This is my observation of the discrepancy:</p>
<pre><code>ixsl:get(., 'baseURI'): https://localhost:4443/7b386331-5a82-46ab-820b-38df78a91456/ SaxonJS2.rt.js:785:84
base-uri(): https://localhost:4443/ SaxonJS2.rt.js:785:84
ixsl:location(): https://localhost:4443/7b386331-5a82-46ab-820b-38df78a91456/
</code></pre> SaxonJS - Feature #6252 (New): Add declaration file for saxon-js to DefinitelyTyped?https://saxonica.plan.io/issues/62522023-11-15T13:06:38ZBoo Zedog
<p>It would be great if we could install a declaration file for saxon-js using <code>npm install --save-dev @types/saxon-js</code></p>
<p>If there is another way to get JSDoc to recognize types for saxon-js please let me know!</p>
<p>Thank you</p> SaxonJS - Bug #6245 (New): broken links in SaxonJS documentation https://saxonica.plan.io/issues/62452023-11-08T14:13:28ZMartin Honnenmartin.honnen@gmx.de
<p><a href="https://www.saxonica.com/saxon-js/documentation2/index.html#!conformance/xslt30" class="external">https://www.saxonica.com/saxon-js/documentation2/index.html#!conformance/xslt30</a> has (at least) two not working links, in the row for <code>vendor-options</code> it says</p>
<blockquote>
<p>Enables syntax extensions for XSLT and XPath, specifically the conditional XSLT extensions described here and the XPath otherwise operator</p>
</blockquote>
<p>where</p>
<ol>
<li>"conditional XSLT extensions described here" links to <a href="https://www.saxonica.com/documentation12/index.html#!extensions/xslt-syntax-extensions" class="external">https://www.saxonica.com/documentation12/index.html#!extensions/xslt-syntax-extensions</a> which gives the error "Error in URI hash-path: Section 'xslt-syntax-extensions' not found in path: extensions/xslt-syntax-extensions"</li>
<li>"otherwise" links to <a href="https://www.saxonica.com/documentation12/index.html#!extensions/syntax-extensions/otherwise" class="external">https://www.saxonica.com/documentation12/index.html#!extensions/syntax-extensions/otherwise</a> which gives a similar error "Error in URI hash-path: Section 'syntax-extensions' not found in path: extensions/syntax-extensions/otherwise"</li>
</ol> SaxonJS - Support #6119 (New): Advice on tracking down log warninghttps://saxonica.plan.io/issues/61192023-07-06T19:21:50ZJohn Cotton
<p>I'm processing '00s of XSL files (with the same XML input) with SaxonJS.</p>
<p>Many throw out this console log:</p>
<p>Cannot compare items of types xs:integer and xs:string: the comparison can succeed only if one of the values is an empty sequence.</p>
<p>It doesn't appear to prevent any output. However, it would be great to know what's causing it.</p>
<p>I've logged the code that's making the warning, but the data at that point is (I think) my "compiled" XSLT, so it's impossible to know where the issue is coming from.</p>
<p>Any advice on finding it?</p>
<p>Regards
John</p> SaxonJS - Bug #6069 (AwaitingInfo): "Unexpected XSLT error" "Cannot add item to tree: (object)"https://saxonica.plan.io/issues/60692023-06-09T05:31:07ZConal Tuohy
<p>I've encountered a strange error running a compiled stylesheet under SaxonJS 2.5 in NodeJS v18.16.0. The stylesheet is compiled on the same platform with the <code>xslt3</code> utility.</p>
<p>This all used to work at some point in the past and I'm not sure what has changed, but I have managed to cut the stylesheet down to a fairly minimal example that reproduces the problem.</p>
<p>My JS code invokes the stylesheet using <code>SaxonJS.transform</code>, and passes parameters to it using <code>stylesheetParams</code>. One of the parameters (<code>$source-uri</code>) is an absolute <code>file:</code> which the stylesheet passes to the <code>doc</code> function, and then applies templates to the result.</p>
<p>The stylesheet implements a pipeline of several transformations by applying templates to a document, capturing the result as a variable, then applying templates to the variable, capturing the result as another variable, applying templates to that, etc. Without that pipeline the stylesheet works OK (i.e. if in the stylesheet below I replace <code><xsl:copy-of select="$phase-1"/></code> with <code><xsl:copy-of select="$source"/></code>, then I get the result I expect; a copy of the source document).</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="nt"><xsl:transform</span> <span class="na">version=</span><span class="s">"3.0"</span> <span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span><span class="nt">></span>
<span class="c"><!--
Test of weird SaxonJS regression
--></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"source-uri"</span><span class="nt">/></span>
<span class="nt"><xsl:template</span> <span class="na">name=</span><span class="s">"xsl:initial-template"</span><span class="nt">></span>
<span class="c"><!-- read the document --></span>
<span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"source"</span> <span class="na">select=</span><span class="s">"doc($source-uri)"</span><span class="nt">/></span>
<span class="c"><!-- transform the document with an identity mode --></span>
<span class="nt"><xsl:variable</span> <span class="na">name=</span><span class="s">"phase-1"</span><span class="nt">></span>
<span class="nt"><xsl:apply-templates</span> <span class="na">mode=</span><span class="s">"identity"</span> <span class="na">select=</span><span class="s">"$source"</span><span class="nt">/></span>
<span class="nt"></xsl:variable></span>
<span class="c"><!-- write the document --></span>
<span class="nt"><xsl:result-document</span> <span class="na">href=</span><span class="s">"/tmp/regression-test-output.xml"</span> <span class="na">method=</span><span class="s">"xml"</span> <span class="na">indent=</span><span class="s">"no"</span><span class="nt">></span>
<span class="nt"><xsl:copy-of</span> <span class="na">select=</span><span class="s">"$phase-1"</span><span class="nt">/></span>
<span class="nt"></xsl:result-document></span>
<span class="nt"></xsl:template></span>
<span class="nt"><xsl:mode</span> <span class="na">name=</span><span class="s">"identity"</span> <span class="na">on-no-match=</span><span class="s">"shallow-copy"</span><span class="nt">/></span>
<span class="nt"></xsl:transform></span>
</code></pre>
<p>Here's the JS API call I use to invoke the stylesheet (my minimal example uses only the <code>source-uri</code> parameter, but the real stylesheet needs those other two):</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">transformationResults</span> <span class="o">=</span> <span class="k">await</span> <span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">transform</span><span class="p">(</span>
<span class="p">{</span>
<span class="na">stylesheetFileName</span><span class="p">:</span> <span class="dl">"</span><span class="s2">/srv/tasks/src/xslt/document-function-regression-test.xsl.sef.json</span><span class="dl">"</span><span class="p">,</span>
<span class="c1">//stylesheetFileName: "/srv/tasks/src/xslt/process-tei-to-page-files.xsl.sef.json",</span>
<span class="na">stylesheetParams</span><span class="p">:</span> <span class="p">{</span>
<span class="na">identifier</span><span class="p">:</span> <span class="nx">identifier</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">source-uri</span><span class="dl">"</span><span class="p">:</span> <span class="nx">sourceURI</span><span class="p">,</span>
<span class="dl">"</span><span class="s2">page-identifier-regex</span><span class="dl">"</span><span class="p">:</span> <span class="nx">configuration</span><span class="p">.</span><span class="nx">ui</span><span class="p">.</span><span class="nx">filename</span><span class="p">.</span><span class="nx">checkNameStructure</span><span class="p">,</span>
<span class="p">},</span>
<span class="na">baseOutputURI</span><span class="p">:</span> <span class="nx">output</span> <span class="p">?</span> <span class="nx">output</span> <span class="p">:</span> <span class="nx">sourceURI</span><span class="p">,</span> <span class="c1">// output into the same folder as the source data file</span>
<span class="p">},</span>
<span class="dl">"</span><span class="s2">async</span><span class="dl">"</span>
<span class="p">);</span>
</code></pre>
<p>Logging the error thrown by SaxonJS.transform produces:</p>
<pre><code> console.error
L {
message: 'An unexpected error occurred in XSLT code. Please report the following information: \n' +
'Error SXJS0004 in document-function-regression-test.xsl line 11:\n' +
'Internal error: Cannot add item to tree (object) <TEI xmlns="http://www.tei-c.org/ns/1.0">\n' +
' <teiHeader>\n' +
' <fileDesc>\n' +
' <titleStmt>\n' +
' <title/>\n' +
' <author/>\n' +
' </titleStmt>\n' +
' <editionStmt>\n' +
' <edition>\n' +
' <date>2022-04-04</date>\n' +
' </edition>\n' +
' </editionStmt>\n' +
' <publicationStmt>\n' +
' <p>unknown</p>\n' +
' </publicationStmt>\n' +
' <sourceDesc>\n' +
' <p>Converted from a Word document</p>\n' +
' </sourceDesc>\n' +
' </fileDesc>\n' +
' <encodingDesc>\n' +
' <appInfo>\n' +
' <application xml:id="docxtotei" ident="TEI_fromDOCX" version="2.15.0">\n' +
' <label>DOCX to TEI</label>\n' +
' </application>\n' +
' </appInfo>\n' +
' </encodingDesc>\n' +
' <revisionDesc>\n' +
' <listChange>\n' +
' <change>\n' +
' <date>2022-04-13T04:31:35Z</date>\n' +
' <name/>\n' +
' </change>\n' +
' </listChange>\n' +
' </revisionDesc>\n' +
' </teiHeader>\n' +
' <text>\n' +
' <body>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example-001</hi> Text of page 1</p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <pb/>\n' +
' </p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example-002</hi> Text of page 2 starts here</p>\n' +
' <p rend="Normal" style="text-align: left; ">More page 2 text.<pb/>\n' +
' </p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example-003</hi> Finally this we have this, the transcription of page 3; the third page of the document, i.e. the page which follows immediately after the second page, also known as “page 2”.</p>\n' +
' <p rend="Normal" style="text-align: left; ">This is more of the third page.<pb/>\n' +
' </p>\n' +
' <p rend="Normal" style="text-align: left; ">\n' +
' <hi rend="Page">msword_example_2-001</hi> This is the first page of transcript of a different item; an item called msword_example_2; this page should not be extracted from the file.</p>\n' +
' </body>\n' +
' </text>\n' +
'</TEI>',
stack: 'Error: \n' +
' at new L (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4109:549)\n' +
' at Object.a [as ga] (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4110:349)\n' +
' at a.append (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4372:52)\n' +
' at Object.q [as gh] (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4362:243)\n' +
' at SC (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4971:310)\n' +
' at e.hf (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4976:85)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4973:289\n' +
' at wc.Object.<anonymous>.ca.forEachItem (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4206:583)\n' +
' at e.Bb (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4973:256)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4376:8\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4358:33\n' +
' at Array.forEach (<anonymous>)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4358:6\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4379:17\n' +
' at Object.push (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4390:143)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4600:290\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4386:258\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4386:309\n' +
' at Object.push (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4390:143)\n' +
' at e (/srv/tasks/node_modules/saxon-js/SaxonJS2N.js:4988:69)\n' +
' at /srv/tasks/node_modules/saxon-js/SaxonJS2N.js:5015:342',
name: 'UnexpectedXSLTError',
code: 'SXJS0004',
xsltLineNr: '11',
xsltModule: 'document-function-regression-test.xsl'
}
</code></pre>
<p>The TEI XML content in that error message is indeed the content of the file identified by the <code>$source-uri</code> parameter.</p>
<p>The stylesheet succeeds when launched from the command line:</p>
<pre><code>node /srv/tasks/node_modules/xslt3 -it -t -xsl:/srv/tasks/src/xslt/document-function-regression-test.xsl source-uri=file:///srv/tasks/src/test-data/Succeeds-word_doc_upload/fake-msword-example/msword_example-tei.xml
SaxonJS 2.5 from Saxonica
Node.js version v18.16.0
Compiling stylesheet /srv/tasks/src/xslt/document-function-regression-test.xsl
Stylesheet compilation time: 0.284s
Initial template: Q{http://www.w3.org/1999/XSL/Transform}initial-template
Asynchronous transform with options: stylesheetText={"N":"package","version":"30",(string), stylesheetBaseURI=file:///srv/tasks/src/xslt/doc(string), stylesheetParams=[object Object](string), outputProperties=[object Object](string), extraOptions=[object Object](string), destination=stdout(string), baseOutputURI=file:///srv/tasks/(string), logLevel=2(string), initialTemplate=Q{http://www.w3.org/1999/XSL/T(string),
SEF generated by SaxonJS 2.5 at 2023-06-09T05:22:48.208Z
Promising to write to file:///tmp/regression-test-output.xml
<?xml version="1.0" encoding="UTF-8"?>
Execution time: 0.147s
Memory used: 29.21Mb
Transformation complete
</code></pre>
<p>The output file <code>ile:///tmp/regression-test-output.xml</code> is there and is a copy of the input file <code>file:///srv/tasks/src/test-data/Succeeds-word_doc_upload/fake-msword-example/msword_example-tei.xml</code></p>
<p>Naturally I can also run the stylesheet successfully under SaxonJ.</p> SaxonJS - Feature #5784 (New): [enhancement] in-browser debuggerhttps://saxonica.plan.io/issues/57842022-12-25T19:34:51ZSasha Firsov
<p>While there are ways to do the debugging via CLI in node console which is runnable under browser ( like in <a href="https://stackblitz.com/github/EPA-WG/custom-element?file=index.html" class="external">https://stackblitz.com/github/EPA-WG/custom-element?file=index.html</a> ), the development effort for browser plugin creation is significantly bigger in comparison to JS-driven debugger in browser.</p>
<p>Once such support added, the integration with native templating would be seamless. The W3C proposal of native templates as part of Declarative Custom Element is still in baking. But the acceptance of XSLT as the base would rely on debugger availability.</p>
<p>By making SaxonJS be a base for debugger, the Saxon would lay the ground as for expanding the own user base as for positioning itself as a lead in restoring XSLT popularity for UI creation.</p> SaxonJS - Feature #5558 (In Progress): Allow clients of SaxonJS to supply a map of custom XPath f...https://saxonica.plan.io/issues/55582022-06-09T23:39:28ZConal Tuohy
<p>There's an existing mechanism whereby JavaScript functions which are in the global Window scope are automatically made available as XPath functions in a "js:" namespace, but this excludes use cases where it's desirable to add custom implementation functions in some standard namespace, e.g. the EXPath function libraries, XProc's XPath extension functions, etc.</p>
<p>I'd like to see this appear in the API in the same way that <code>params</code> member of the <code>options</code> object appears in the <code>evaluate</code> function; i.e. as an additional <code>functions</code> member of <code>options</code>, whose value is a JavaScript object mapping QNames to JavaScript functions.</p> SaxonJS - Feature #5557 (New): allow clients of SaxonJS to supply a URI resolver functionhttps://saxonica.plan.io/issues/55572022-06-09T23:24:34ZConal Tuohy
<p>SaxonJS doesn't yet allow users to supply their own URI resolver.</p>
<p>Related discussion in XML.com slack instance: <a href="https://xmlcom.slack.com/archives/C011NLXE4DU/p1654568529708119" class="external">https://xmlcom.slack.com/archives/C011NLXE4DU/p1654568529708119</a></p>
<p>I came across the need for such a feature while trying to make resources stored in browser local storage (IndexedDB) available to XSLT running in the browser. I was hoping to be able to supply a resolver that would allow me to handle indexeddb: URIs.</p>
<p>I tried using the browser's "Service Worker" functionality, which can intercept the browser's "fetch" requests, and then either allow them to be handled normally, or else return a promise to fulfill them in some other way. Unfortunately I found that approach is applicable only to URI schemes which the browser already knows about (e.g. http, https, file ...) and also is constrained by some irrelevant security restrictions.</p> SaxonJS - Feature #5543 (In Progress): Add the ability to insert before/after an elementhttps://saxonica.plan.io/issues/55432022-05-27T09:36:35ZNorm Tovey-Walsh
<p>From XML.com Slack, it would be nice if <code><xsl:result-document></code> had methods to insert before/after an element.</p> SaxonJS - Bug #5474 (New): Create an ixsl:reset-indexes function?https://saxonica.plan.io/issues/54742022-05-06T14:38:57ZNorm Tovey-Walsh
<p>The reset-indexes API we added to Saxon 2.4 has no convenient ixsl: function that can be called from XSLT. Should we add one in 3.0?</p> Saxon - Support #5469 (New): Combining Configuration Fileshttps://saxonica.plan.io/issues/54692022-05-03T15:25:55ZScott Louzon
<p>To whom it may concern,</p>
<p>I have moved my XSLT creation methodology, in part, to using XSLT packages.
This has been a great new feature over the include/import flow I was previously using.</p>
<p>My last issue is with the encapsulation of the configuration files for pointing to the packages on the cmd-line "-config:".
<a href="https://www.saxonica.com/documentation9.5/configuration/configuration-file/" class="external">https://www.saxonica.com/documentation9.5/configuration/configuration-file/</a>
Unfortunately, I don't see mention of in the example.</p>
<p>Take the following example:
Car package is at the top.
Car package uses Frame, Engine, Wheels, etc.. packages.
Each of the Frame, Engine, Wheel packages could use many other packages, and so on below that.
However, when using the Car package, I don't want to care about the location or structure of everything downstream when building my configuration file for the Car package.</p>
<p>I am wondering what the current methodology recommendation is for building this hierarchy of configuration XML files when using XSLT packages?</p>
<ul>
<li>Always have a "massive" top-level package specify the location of everything you could possibly need to use?</li>
<li>Have a tool (possibly an XSLT) combine all the XML configuration files before-hand, and then use the generated combined file on the command-line?</li>
<li>Some better built in way of pointing to a lower-level configuration file, which in turn can point to the packages it needs, as well as more configuration files?</li>
<li>Don't use configurations files at all, potentially better way to specify package locations and connections?</li>
</ul>
<p>Based on all the information you could pass into a configuration file besides , like XSLT versions and such, I imagine combining configuration files could get tricky.</p>
<p>In general, I want to avoid making a tool to combine XML configuration files in an encapsulated manner, if there is already a better built-in way to do what I want.</p> SaxonJS - Feature #5057 (New): Constructing JS objectshttps://saxonica.plan.io/issues/50572021-08-07T09:49:25ZMartynas Jusevicius
<p>Hi. I cannot seem to find a native way to construct JS objects, which makes porting JS code to XSLT complicated. It think it was possible with Saxon-CE, but I might be wrong.</p>
<p>I know there is <code>ixsl:eval()</code>, but since it accepts string as parameter, how does one pass a JS object from a <code>$var</code> for example? It does not seem possible.</p>
<p>So how would I port some simple JS code like the following?</p>
<pre><code class="js syntaxhl" data-language="js"> <span class="kd">var</span> <span class="nx">map</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">ol</span><span class="p">.</span><span class="nb">Map</span><span class="p">({</span>
<span class="na">target</span><span class="p">:</span> <span class="dl">'</span><span class="s1">map</span><span class="dl">'</span><span class="p">,</span>
<span class="na">layers</span><span class="p">:</span> <span class="p">[</span>
<span class="k">new</span> <span class="nx">ol</span><span class="p">.</span><span class="nx">layer</span><span class="p">.</span><span class="nx">Tile</span><span class="p">({</span>
<span class="na">source</span><span class="p">:</span> <span class="k">new</span> <span class="nx">ol</span><span class="p">.</span><span class="nx">source</span><span class="p">.</span><span class="nx">OSM</span><span class="p">()</span>
<span class="p">})</span>
<span class="p">],</span>
<span class="na">view</span><span class="p">:</span> <span class="k">new</span> <span class="nx">ol</span><span class="p">.</span><span class="nx">View</span><span class="p">({</span>
<span class="na">center</span><span class="p">:</span> <span class="nx">ol</span><span class="p">.</span><span class="nx">proj</span><span class="p">.</span><span class="nx">fromLonLat</span><span class="p">([</span><span class="mf">37.41</span><span class="p">,</span> <span class="mf">8.82</span><span class="p">]),</span>
<span class="na">zoom</span><span class="p">:</span> <span class="mi">4</span>
<span class="p">})</span>
<span class="p">});</span>
</code></pre>
<p><a href="https://openlayers.org/en/latest/doc/quickstart.html" class="external">https://openlayers.org/en/latest/doc/quickstart.html</a></p> SaxonJS - Feature #5011 (New): Bundle browser version in NPM packagehttps://saxonica.plan.io/issues/50112021-05-28T14:01:48ZDaniel Naab
<p>Is there any possibility of distributing the browser version of Saxon-JS in the NPM module?</p>
<p>For context, the package.json may include a <code>browser</code> attribute, that specifies a browser package that web bundlers may use when the library is imported. <a href="https://docs.npmjs.com/cli/v7/configuring-npm/package-json#browser" class="external">https://docs.npmjs.com/cli/v7/configuring-npm/package-json#browser</a></p>
<p>Additionally, a <code>module</code> attribute may specify an ESM module.</p>
<p>Including the browser bundle in the NPM package would ease dependency management, and facilitate library usage in applications with both node.js and browser-based components.</p>