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> SaxonC - Bug #6299 (New): Add a Makefile to the release for building of the SaxonC C/C++ API libraryhttps://saxonica.plan.io/issues/62992023-12-20T13:02:23ZO'Neil Delprattoneil@saxonica.com
<p>Reported by user here <a href="https://stackoverflow.com/questions/77684816/undefined-reference-error-when-link-to-saxon-library-in-c/77690492#77690492" class="external">https://stackoverflow.com/questions/77684816/undefined-reference-error-when-link-to-saxon-library-in-c/77690492#77690492</a></p>
<p>The SaxonC release should contain a MakeFile to build the C/C++ library. This is something we attempted to do long time ago, but for some reason we proceed with its use. Since we are now using Graalvm we should use a Makefile.</p> SaxonC - Bug #6297 (New): 12.4.1 command build errors on CentOS 7https://saxonica.plan.io/issues/62972023-12-19T11:50:46ZTony Graham
<p>Running <code>build-saxonc-commands.sh</code> on CentOS 7 generated errors about the C version, such as:</p>
<pre><code>Transform.c: In function ‘transform’:
Transform.c:33:3: error: ‘for’ loop initial declarations are only allowed in C99 mode
for (int i = 1; i < argc; i++) {
^
Transform.c:33:3: note: use option -std=c99 or -std=gnu99 to compile your code
</code></pre>
<p>After adding <code>-std=c99</code> to the GCC command lines, there were errors about <code>int64_t</code>, such as:</p>
<pre><code>In file included from ../Saxon.C.API/SaxonCGlue.c:1:0:
../Saxon.C.API/SaxonCGlue.h:92:3: error: unknown type name ‘int64_t’
int64_t value; /*!< Internal use only. The value of the parameter points
^
</code></pre>
<p>That was worked around by adding <code>#include <stdint.h></code> for <code>__LINUX__</code> and <code>__APPLE__</code> in <code>SaxonCGlue.h</code>. I don't know whether <code>#include <stdint.h></code> would be necessary for <code>__APPLE__</code>.</p>
<p>Also, it's not clear why <code>#include <stdio.h></code> is included a second time for <code>__LINUX__</code> and <code>__APPLE__</code>.</p>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gd">--- build-saxonc-commands.sh~ 2023-12-01 12:17:46.000000000 +0000
</span><span class="gi">+++ build-saxonc-commands.sh 2023-12-19 08:52:51.329869064 +0000
</span><span class="p">@@ -4,15 +4,15 @@</span>
parent_path=$( cd "$(dirname "$0")" ; pwd -P )
library_dir=${1-$(pwd -P)}/../libs/nix
#cd "$parent_path"
<span class="gd">-gcc -m64 -fPIC -I../Saxon.C.API/graalvm -c ../Saxon.C.API/SaxonCGlue.c -o SaxonCGlue.o $1
</span><span class="gi">+gcc -std=c99 -m64 -fPIC -I../Saxon.C.API/graalvm -c ../Saxon.C.API/SaxonCGlue.c -o SaxonCGlue.o $1
</span>
<span class="gd">-gcc -m64 -fPIC -I../Saxon.C.API/graalvm Transform.c -o transform -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span><span class="gi">+gcc -std=c99 -m64 -fPIC -I../Saxon.C.API/graalvm Transform.c -o transform -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span>
<span class="gd">-gcc -m64 -fPIC -I../Saxon.C.API/graalvm Query.c -o query -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span><span class="gi">+gcc -std=c99 -m64 -fPIC -I../Saxon.C.API/graalvm Query.c -o query -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span>
<span class="gd">-gcc -m64 -fPIC -I../Saxon.C.API/graalvm Gizmo.c -o gizmo -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span><span class="gi">+gcc -std=c99 -m64 -fPIC -I../Saxon.C.API/graalvm Gizmo.c -o gizmo -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span>
if [ -f Validate.c ]; then
<span class="gd">- gcc -m64 -fPIC -I../Saxon.C.API/graalvm Validate.c -o validate -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span><span class="gi">+ gcc -std=c99 -m64 -fPIC -I../Saxon.C.API/graalvm Validate.c -o validate -ldl -lc SaxonCGlue.o -L$library_dir -lsaxon-hec-12.4.1 $1
</span> fi
</code></pre>
<pre><code class="diff syntaxhl" data-language="diff"><span class="gd">--- SaxonCGlue.h~ 2023-12-01 12:17:48.000000000 +0000
</span><span class="gi">+++ SaxonCGlue.h 2023-12-19 09:00:42.996931099 +0000
</span><span class="p">@@ -17,6 +17,7 @@</span>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
<span class="gi">+#include <stdint.h>
</span> #else
#include <stdint.h>
#include <windows.h>
</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> Saxon - Bug #6183 (In Progress): "fallback=no" on UCA collation not working in EE editionhttps://saxonica.plan.io/issues/61832023-08-23T01:29:51ZTrevor Lawrence
<p>We are using a licensed (as of 05/04/23) edition of SaxonJ-EE 11.5.</p>
<p>We're using the <code><xsl:sort></code> instruction within an <code><xsl:for-each-group></code> with a custom-defined UCA collation URI. While debugging an issue with it we decided to add the <code>fallback=no</code> parameter to see if we were misusing one of the options, and instead got a message saying it's not supported in Saxon-HE.</p>
<p>Attached to this issue is a minimal stylesheet that reproduces the issue. Invoking it with this command:</p>
<pre><code class="shell syntaxhl" data-language="shell">java <span class="nt">-cp</span> <path_to_xml_resolver_4.6.4>:<path_to_saxon_EE_11.5> <span class="se">\</span>
net.sf.saxon.Transform <span class="se">\</span>
<span class="nt">-xsl</span>:transform-with-EE-feature.xsl <span class="se">\</span>
<span class="nt">-o</span>:file.xml <span class="se">\</span>
<span class="nt">-it</span> <span class="se">\</span>
<span class="nt">-config</span>:<path_to_our_config_and_license>
</code></pre>
<p>gives:</p>
<pre><code>Error at xsl:sort on line 9 column 141 of transform-with-EE-feature.xsl:
XTDE1035 Failed to load collation
http://www.w3.org/2013/collation/UCA?lang=en;maxVariable=symbol;strength=4;alternate=shifted;fallback=no: Error in UCA Collation URI http://www.w3.org/2013/collation/UCA?lang=en;maxVariable=symbol;strength=4;alternate=shifted;fallback=no: fallback=no is not supported in Saxon-HE
Errors were reported during stylesheet compilation
</code></pre>
<p>We currently pull down Saxon-EE from your new Maven repo and XML Resolver from Maven central.</p> 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> SaxonC - Feature #5833 (New): Add the Path class as argument to method PyQueryProcessor.set_query...https://saxonica.plan.io/issues/58332023-01-18T17:48:12ZO'Neil Delprattoneil@saxonica.com
<p>Following on from the stackoverflow issue: <a href="https://stackoverflow.com/questions/75142854/how-to-use-the-collection-function-with-saxonche/75162395#75162395" class="external">https://stackoverflow.com/questions/75142854/how-to-use-the-collection-function-with-saxonche/75162395#75162395</a></p>
<p>It would be good to add the Path class object (<a href="https://docs.python.org/3/library/pathlib.html" class="external">https://docs.python.org/3/library/pathlib.html</a>) as an argument on the PyQueryProcessor.set_query_base_uri() method. Currently this method only access the URI as a string.</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 #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> SaxonC - Bug #5344 (In Progress): java.lang.UnsatisfiedLinkError: Can't load library: /C:/Progra...https://saxonica.plan.io/issues/53442022-02-21T23:01:47ZO'Neil Delprattoneil@saxonica.com
<p>Reported by user in the forum post: <a href="https://saxonica.plan.io/boards/4/topics/8562" class="external">https://saxonica.plan.io/boards/4/topics/8562</a></p>
<p>Writing an extension function on Windows C++ and PHP currently fails with the following error message:</p>
<pre><code> java.lang.UnsatisfiedLinkError: Can't load library: /C:/Program Files/Saxonica/SaxonC EE 11.2/samples/cppTests/cppExtensionFunction.dll
</code></pre>
<p>The failure is in the Java code. We incorrectly create a leading slash: We are failing resolve the file path. Specifically the cwd is not currently been passed and we fail the fallback of using the SAXONC_HOME environment variable.</p> SaxonJS - Feature #4736 (New): Add syntax for an external JavaScript object typehttps://saxonica.plan.io/issues/47362020-09-14T15:03:14ZDebbie Lockettdebbie@saxonica.com
<p>We should add a new XPath <code>ItemType</code> for external JavaScript objects, so that type information for variables, etc. can be more specific than just <code>item()</code>. e.g. for storing JavaScript objects returned from calling IXSL extension functions, and global JS functions. (And to avoid conversion to XDM types, where this would otherwise happen.)</p> SaxonJS - Feature #4735 (New): Add multipart support in HTTP clienthttps://saxonica.plan.io/issues/47352020-09-14T12:28:38ZDebbie Lockettdebbie@saxonica.com
<p>As documented, multipart HTTP requests and responses are not currently supported properly by the Saxon-JS HTTP client (<code>ixsl:schedule-action/@http-request</code>).</p>
<p>See <a href="https://www.saxonica.com/saxon-js/documentation/index.html#!development/http" class="external">https://www.saxonica.com/saxon-js/documentation/index.html#!development/http</a> :</p>
<blockquote>
<p>Note that multipart HTTP requests are not currently implemented. Some rules anticipate these being available.</p>
</blockquote>
<blockquote>
<p>Multipart responses are not currently properly handled. A multipart response will be returned as one text/plain body in body (rather than an array of body parts in multipart-bodies.)</p>
</blockquote>
<p>It has always been on the todo list to extend the support for multipart HTTP messages, but there has been no progress on this for some time.</p>
<p>The lack of support is an issue for sending <code>FormData</code> by HTTP. See notes <a class="issue tracker-4 status-3 priority-2 priority-default closed" title="Support: Upgrading AtomGraph application from Saxon-CE to Saxon-JS 2 (Closed)" href="https://saxonica.plan.io/issues/4732#note-4">#4732#note-4</a> and <a class="issue tracker-4 status-3 priority-2 priority-default closed" title="Support: Upgrading AtomGraph application from Saxon-CE to Saxon-JS 2 (Closed)" href="https://saxonica.plan.io/issues/4732#note-6">#4732#note-6</a> in Issue <a class="issue tracker-4 status-3 priority-2 priority-default closed" title="Status: Closed" href="https://saxonica.plan.io/issues/4732">Support #4732: Upgrading AtomGraph application from Saxon-CE to Saxon-JS 2</a>.</p> W3C QT Specifications - Bug #4222 (New): [xslt30] Visibility of xsl:paramhttps://saxonica.plan.io/issues/42222019-05-16T23:00:16ZMichael Kaymike@saxonica.com
<p>The XSLT 3,0 spec makes confusingly inconsistent statements about the visibility of global parameters.</p>
<ul>
<li>
<p>The grammar for <code>xsl:param</code> does not allow a <code>visibility</code> attribute</p>
</li>
<li>
<p>In §3.5.3.1, under <code>xsl:expose</code>, we say "The visibility of a variable declared using an <code>xsl:param</code> element is always public."</p>
</li>
<li>
<p>§9.6 (Static parameters) says: "When the static attribute [of <code>xsl:param</code>] is present with the value yes, the visibility attribute must not have a value other than <code>private</code>." But in fact, no visibility attribute is allowed by the grammar. It is clear in this section that the intent is for static parameters to always be private: there is a note explaining why (specifically, so they cannot be overridden, which is necessary to allow separate compilation of packages; however, I don't see why visibility="final" can't be allowed, which would achieve the same aim.</p>
</li>
</ul>
<p>I think one aspect of this that the spec fails to address is: when package P "uses" package Q, it is presumably using a version of Q whose static parameters have been bound to particular values. But there is no way for P to say what these values should be. There can be two compiled instances of Q with different values bound to the static parameters, and the effect of using these two instances is likely to be quite different.</p>