Saxonica Developer Community: Issueshttps://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2024-03-27T11:18:36ZSaxonica Developer Community
Planio Saxon - Bug #6379 (New): Default implementation of fn:deep-equalhttps://saxonica.plan.io/issues/63792024-03-27T11:18:36ZNorm Tovey-Walsh
<p>I happened to trace my way through a call to deep equal in Saxon HE 12.4 and I was a little bit surprised to find that it's using the <code>DeepEqual40</code> implementation. I wonder if that was intentional...</p> 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> 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> 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 - 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 - Bug #6132 (New): documentPool passed to SaxonJS.transform doesn't seem to be used if th...https://saxonica.plan.io/issues/61322023-07-18T16:53:41ZMartin Honnenmartin.honnen@gmx.de
<p>For SaxonJS.transform, I can pass a <code>documentPool</code>, mapping URLs to resources, to allow preloading resources or loading resources from a string.</p>
<p>An example of that is e.g. a stylesheet (shown here as XSLT, for SaxonJS it will be compiled to sef.json)</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="cp"><?xml version="1.0" encoding="utf-8"?></span>
<span class="nt"><xsl:stylesheet</span> <span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span>
<span class="na">version=</span><span class="s">"3.0"</span>
<span class="na">xmlns:xs=</span><span class="s">"http://www.w3.org/2001/XMLSchema"</span>
<span class="na">exclude-result-prefixes=</span><span class="s">"#all"</span>
<span class="na">expand-text=</span><span class="s">"yes"</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="nt"><xsl:sequence</span> <span class="na">select=</span><span class="s">"doc('doc1.xml') => serialize(map{'method':'xml'})"</span><span class="nt">/></span>
<span class="nt"></xsl:template></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>and (for Node.js) Javascript code like</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">path</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">path</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">url</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">SaxonJS</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">saxon-js</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">xmlResource1</span> <span class="o">=</span> <span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">getResource</span><span class="p">({</span><span class="dl">'</span><span class="s1">type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">xml</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">text</span><span class="dl">'</span> <span class="p">:</span> <span class="dl">'</span><span class="s1"><root>foo</root></span><span class="dl">'</span> <span class="p">});</span>
<span class="kd">var</span> <span class="nx">doc1Uri</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">doc1.xml</span><span class="dl">'</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">docPool</span> <span class="o">=</span> <span class="p">{};</span>
<span class="nx">xmlResource1</span><span class="p">.</span><span class="nx">then</span><span class="p">(</span><span class="nx">doc</span> <span class="o">=></span> <span class="p">{</span> <span class="nx">docPool</span><span class="p">[</span><span class="nx">url</span><span class="p">.</span><span class="nx">pathToFileURL</span><span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span><span class="p">(</span><span class="dl">'</span><span class="s1">.</span><span class="dl">'</span><span class="p">,</span> <span class="nx">doc1Uri</span><span class="p">))]</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">;</span> <span class="p">})</span>
<span class="p">.</span><span class="nx">then</span><span class="p">(()</span> <span class="o">=></span> <span class="p">{</span>
<span class="c1">//console.log(docPool);</span>
<span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">transform</span><span class="p">({</span> <span class="na">documentPool</span><span class="p">:</span> <span class="nx">docPool</span><span class="p">,</span> <span class="na">stylesheetLocation</span><span class="p">:</span> <span class="dl">'</span><span class="s1">documentPoolTest1.xsl.sef.json</span><span class="dl">'</span> <span class="p">},</span> <span class="dl">'</span><span class="s1">async</span><span class="dl">'</span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="nx">result</span> <span class="o">=></span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">result</span><span class="p">.</span><span class="nx">principalResult</span><span class="p">));</span>
<span class="p">});</span>
<span class="p">});</span>
</code></pre>
<p>When I run that with Node I get e.g.</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>&lt;root&gt;foo&lt;/root&gt;
</code></pre>
<p>so the <code>doc1.xml</code> is resolved from my passed in <code>documentPool</code> property.</p>
<p>However, when I do the same with an XSLT stylesheet having a function exposing <code>xsl:evaluate</code> with a public function and then call that function with <code>SaxonJS.transform</code> to pass in e.g. a string doing <code>doc("doc1.xml")</code> it seems the documentPool is not taken into account and instead I get an error that the file <code>doc1.xml</code> is not found:</p>
<pre><code>Transformation failure: Error FODC0002 at exposeXslEvaluate.xsl#17
Cannot read file file:///C:/Users/marti/OneDrive/Documents/xslt/saxonjs-documentPool/doc1.xml - ENOENT: no such file or directory, open 'C:\Users\marti\OneDrive\Documents\xslt\saxonjs-documentPool\doc1.xml'
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error
at new L (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4109:549)
at Object.readFile (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4713:171)
at Object.readFile (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4108:74)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4340:316
at a (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4338:294)
at Object.Ec (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4340:280)
at doc (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4513:298)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4632:444
at Object.I [as evaluate] (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4600:203)
at Object.evaluateXDM (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4933:464)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4630:290
at Object.push (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4390:245)
at e (C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:4987:320)
at C:\Users\marti\AppData\Roaming\npm\node_modules\saxon-js\SaxonJS2N.js:5015:342 {
message: "Cannot read file file:///C:/Users/marti/OneDrive/Documents/xslt/saxonjs-documentPool/doc1.xml - ENOENT: no such file or directory, open 'C:\\Users\\marti\\OneDrive\\Documents\\xslt\\saxonjs-documentPool\\doc1.xml'",
name: 'XError',
code: 'FODC0002',
xsltLineNr: '17',
xsltModule: 'exposeXslEvaluate.xsl'
}
</code></pre>
<p>A sample XSLT is e.g.</p>
<pre><code class="xml syntaxhl" data-language="xml"><span class="nt"><xsl:stylesheet</span>
<span class="na">xmlns:xsl=</span><span class="s">"http://www.w3.org/1999/XSL/Transform"</span>
<span class="na">version=</span><span class="s">"3.0"</span>
<span class="na">xmlns:mf=</span><span class="s">"http://example.com/mf"</span>
<span class="na">xmlns:xs=</span><span class="s">"http://www.w3.org/2001/XMLSchema"</span>
<span class="na">exclude-result-prefixes=</span><span class="s">"#all"</span><span class="nt">></span>
<span class="nt"><xsl:function</span> <span class="na">name=</span><span class="s">"mf:eval"</span> <span class="na">as=</span><span class="s">"item()*"</span> <span class="na">visibility=</span><span class="s">"public"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"expression"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"context-item"</span> <span class="na">as=</span><span class="s">"item()?"</span><span class="nt">/></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"params"</span> <span class="na">as=</span><span class="s">"map(xs:QName, item()*)"</span><span class="nt">/></span>
<span class="nt"><xsl:evaluate</span> <span class="na">xpath=</span><span class="s">"$expression"</span> <span class="na">context-item=</span><span class="s">"$context-item"</span> <span class="na">with-params=</span><span class="s">"$params"</span><span class="nt">/></span>
<span class="nt"></xsl:function></span>
<span class="nt"><xsl:function</span> <span class="na">name=</span><span class="s">"mf:eval"</span> <span class="na">as=</span><span class="s">"item()*"</span> <span class="na">visibility=</span><span class="s">"public"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"expression"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><xsl:evaluate</span> <span class="na">xpath=</span><span class="s">"$expression"</span> <span class="na">context-item=</span><span class="s">"()"</span> <span class="na">with-params=</span><span class="s">"map{}"</span><span class="nt">/></span>
<span class="nt"></xsl:function></span>
<span class="nt"><xsl:function</span> <span class="na">name=</span><span class="s">"mf:eval"</span> <span class="na">as=</span><span class="s">"item()*"</span> <span class="na">visibility=</span><span class="s">"public"</span><span class="nt">></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"expression"</span> <span class="na">as=</span><span class="s">"xs:string"</span><span class="nt">/></span>
<span class="nt"><xsl:param</span> <span class="na">name=</span><span class="s">"context-item"</span> <span class="na">as=</span><span class="s">"item()?"</span><span class="nt">/></span>
<span class="nt"><xsl:evaluate</span> <span class="na">xpath=</span><span class="s">"$expression"</span> <span class="na">context-item=</span><span class="s">"$context-item"</span> <span class="na">with-params=</span><span class="s">"map{}"</span><span class="nt">/></span>
<span class="nt"></xsl:function></span>
<span class="nt"></xsl:stylesheet></span>
</code></pre>
<p>the Javascript code is e.g.</p>
<pre><code class="javascript syntaxhl" data-language="javascript"><span class="kd">const</span> <span class="nx">path</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">path</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">url</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">url</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">const</span> <span class="nx">SaxonJS</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="dl">'</span><span class="s1">saxon-js</span><span class="dl">'</span><span class="p">);</span>
<span class="kd">var</span> <span class="nx">xmlResource1</span> <span class="o">=</span> <span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">getResource</span><span class="p">({</span><span class="dl">'</span><span class="s1">type</span><span class="dl">'</span><span class="p">:</span> <span class="dl">'</span><span class="s1">xml</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">text</span><span class="dl">'</span> <span class="p">:</span> <span class="dl">'</span><span class="s1"><root>foo</root></span><span class="dl">'</span> <span class="p">});</span>
<span class="kd">var</span> <span class="nx">doc1Uri</span> <span class="o">=</span> <span class="dl">'</span><span class="s1">doc1.xml</span><span class="dl">'</span><span class="p">;</span>
<span class="kd">var</span> <span class="nx">docPool</span> <span class="o">=</span> <span class="p">{};</span>
<span class="nx">xmlResource1</span><span class="p">.</span><span class="nx">then</span><span class="p">(</span><span class="nx">doc</span> <span class="o">=></span> <span class="p">{</span> <span class="nx">docPool</span><span class="p">[</span><span class="nx">url</span><span class="p">.</span><span class="nx">pathToFileURL</span><span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span><span class="p">(</span><span class="dl">'</span><span class="s1">.</span><span class="dl">'</span><span class="p">,</span> <span class="nx">doc1Uri</span><span class="p">))]</span> <span class="o">=</span> <span class="nx">doc</span><span class="p">;</span> <span class="p">})</span>
<span class="p">.</span><span class="nx">then</span><span class="p">(()</span> <span class="o">=></span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">docPool</span><span class="p">);</span>
<span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">transform</span><span class="p">({</span>
<span class="na">documentPool</span><span class="p">:</span> <span class="nx">docPool</span><span class="p">,</span>
<span class="na">stylesheetLocation</span><span class="p">:</span> <span class="dl">'</span><span class="s1">exposeXslEvaluate.xsl.sef.json</span><span class="dl">'</span><span class="p">,</span>
<span class="na">stylesheetBaseURI</span><span class="p">:</span> <span class="nx">url</span><span class="p">.</span><span class="nx">pathToFileURL</span><span class="p">(</span><span class="nx">path</span><span class="p">.</span><span class="nx">resolve</span><span class="p">(</span><span class="dl">'</span><span class="s1">.</span><span class="dl">'</span><span class="p">,</span> <span class="dl">'</span><span class="s1">exposeXslEvaluate.xsl</span><span class="dl">'</span><span class="p">)),</span>
<span class="na">initialFunction</span><span class="p">:</span> <span class="dl">'</span><span class="s1">Q{http://example.com/mf}eval</span><span class="dl">'</span><span class="p">,</span>
<span class="na">functionParams</span><span class="p">:</span> <span class="p">[</span><span class="dl">'</span><span class="s1">doc("doc1.xml")</span><span class="dl">'</span><span class="p">],</span>
<span class="na">destination</span><span class="p">:</span> <span class="dl">'</span><span class="s1">raw</span><span class="dl">'</span>
<span class="p">},</span> <span class="dl">'</span><span class="s1">async</span><span class="dl">'</span><span class="p">).</span><span class="nx">then</span><span class="p">(</span><span class="nx">result</span> <span class="o">=></span> <span class="p">{</span>
<span class="nx">console</span><span class="p">.</span><span class="nx">log</span><span class="p">(</span><span class="nx">SaxonJS</span><span class="p">.</span><span class="nx">serialize</span><span class="p">(</span><span class="nx">result</span><span class="p">.</span><span class="nx">principalResult</span><span class="p">));</span>
<span class="p">});</span>
<span class="p">});</span>
</code></pre> Saxon - Bug #6127 (New): Documentation: argument keywords in function libraryhttps://saxonica.plan.io/issues/61272023-07-10T07:56:11ZMichael Kaymike@saxonica.com
<p>The documentation of the function library has not kept up to date with changes in argument keywords in the 4.0 specification. For example</p>
<p><a href="https://www.saxonica.com/documentation12/index.html#!functions/fn/reverse" class="external">https://www.saxonica.com/documentation12/index.html#!functions/fn/reverse</a></p>
<p>lists the signature as</p>
<pre><code>reverse($arg as item()*) ➔ item()*
</code></pre>
<p>but the argument keyword has changed from <code>arg</code> to <code>input</code>. The argument keywords are relevant in 4.0 because arguments can be identified by name in a function call.</p> SaxonC - Bug #5871 (New): Correct pylint warningshttps://saxonica.plan.io/issues/58712023-02-05T08:06:14ZNorm Tovey-Walsh
<p>If you run <code>pylint</code> against a script that uses our wheels, you'll get warnings like this:</p>
<pre><code>module.py:7:0: E0611: No name 'PySaxonProcessor' in module 'saxonche' (no-name-in-module)
</code></pre>
<p>These warnings also appear in IDEs that do linting and I presume the lack of declarations "in the module" means that IDEs have no way to offer completions.</p>
<p>I assume this could be fixed by putting something in, probably, a <code>__init__.py</code> file, but I don't know what.</p> SaxonJS - Bug #5807 (New): current() does not work when invoked via xsl:evaluatehttps://saxonica.plan.io/issues/58072023-01-11T17:50:01ZJohn Dziurlaj
<p>When passing the following expression to <code>@xpath</code> of <code>xsl:evaluate</code> in SaxonJS, <code>instance('i2')/month[@code = current()]</code> , I get the error "The current() construct is not implemented in SaxonJS"</p>
<ul>
<li>Stylesheet location (context): <a href="https://github.com/Saxonica/Saxon-Forms/blob/5ab05598219361cfb56b730da9d30409b0726cf1/src/saxon-xforms.xsl#L1468-L1481" class="external">https://github.com/Saxonica/Saxon-Forms/blob/5ab05598219361cfb56b730da9d30409b0726cf1/src/saxon-xforms.xsl#L1468-L1481</a>
</li>
<li>See also: <a href="https://github.com/Saxonica/Saxon-Forms/issues/20" class="external">https://github.com/Saxonica/Saxon-Forms/issues/20</a>
</li>
<li>Normative reference: <a href="https://www.w3.org/TR/xforms11/#fn-current" class="external">https://www.w3.org/TR/xforms11/#fn-current</a>
</li>
</ul>
<p>Note that this error is masked by another error related to namespace declarations, which is more fully described in Saxon-Forms <a class="issue tracker-1 status-3 priority-2 priority-default closed" title="Bug: position variable incorrectly removed in ForClause (Closed)" href="https://saxonica.plan.io/issues/20">#20</a>. (the error can be suppressed by removing the <code>@namespace-context</code> from <code>xsl:evaluate</code>).</p> SaxonJS - Bug #5743 (New): Expand text interacts badly with try/catchhttps://saxonica.plan.io/issues/57432022-11-24T16:37:00ZNorm Tovey-Walsh
<p>This test:</p>
<pre><code> <fred>
<xsl:try>
{error((), "BANG")}
<xsl:catch>
<xsl:sequence select="'CAUGHT'"/>
</xsl:catch>
</xsl:try>
</fred>
</code></pre>
<p>produces</p>
<pre><code><fred/>
</code></pre>
<p>where I think it should produce</p>
<pre><code><fred>CAUGHT</fred>
</code></pre>
<p>(As it does with SaxonJ).</p> SaxonC - Bug #5621 (New): C++ build-windows.bat gives warning "SaxonProcessor.obj : warning LNK40...https://saxonica.plan.io/issues/56212022-07-28T18:13:26ZMartin Honnenmartin.honnen@gmx.de
<p>The build bat file for Windows HEC 11.4 still needs some improvement, for all samples it outputs a warning</p>
<blockquote>
<p>C++ build-windows.bat gives warning "SaxonProcessor.obj : warning LNK4042: object specified more than once; extras ignored</p>
</blockquote>
<p>so somewhere SaxonProcessor.c is duplicated in the commands.</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> SaxonC - Bug #5025 (New): Documentation on setProperty/getProperty methodshttps://saxonica.plan.io/issues/50252021-06-17T08:36:31ZMichael Kaymike@saxonica.com
<p>For some classes, e.g. Xslt30Processor, the API documentation for the getProperty/setProperty methods is sketchy, in terms of listing the available properties and expected values.</p>
<p>For other classes, e.g. SchemaValidator, this information is completely missing.</p> SaxonJS - Bug #4815 (New): Conversion of XDM maps to JS objectshttps://saxonica.plan.io/issues/48152020-10-30T10:05:35ZDebbie Lockettdebbie@saxonica.com
<p>On the XML.com Slack general channel, Pieter Lamers asked the following:</p>
<blockquote>
<p>I'm trying to get scrollIntoView to work smoothly. Now, <code>ixsl:call($target, 'scrollIntoView',[])</code> works, but I don't know how to pass the <code>ScrollIntoViewOptions</code> into the array. [...] This is what I would typically want to achieve:
<code>element.scrollIntoView({behavior: "smooth", block: "start", inline: "nearest"});</code></p>
</blockquote>
<p>Intuitively, users expect to be able to supply a <code>map(*)</code> in the array for the 3rd argument to <code>ixsl:call</code>; but this will not work as expected, because the XDM to JS conversion does not automatically convert XDM maps to JavaScript object literals. (See <a href="https://www.saxonica.com/saxon-js/documentation/index.html#!xdm/conversions" class="external">https://www.saxonica.com/saxon-js/documentation/index.html#!xdm/conversions</a>). Instead if an XDM map is supplied here, it will be converted to a "wrapped XDM map object", which the <code>scrollIntoView</code> JavaScript method simply ignores.</p>
<p>Martin Honnen suggested a couple of work arounds:</p>
<blockquote>
<p>you might want to set up a Javascript variable <code>var options = {behavior: "smooth", block: "start", inline: "nearest"};</code> and pass it to the XSLT with e.g.
<code>SaxonJS.transform({ stylesheetLocation: 'sheet1.sef.json', sourceLocation: 'sample1.xml', stylesheetParams: { options: options } } )</code>
In your XSLT you then use <code>ixsl:call(., 'scrollIntoView', [ $options])</code> and declare <code><xsl:param name="options" required="true"/></code></p>
</blockquote>
<blockquote>
<p>Or construct the scroll options inside XSLT with e.g. <code><xsl:param name="scrollOptions" as="xs:string" expand-text="no">{ "behavior" : "smooth", "block" : "start", "inline": "nearest" }</xsl:param></code> and <code>ixsl:call(., 'scrollIntoView', [ ixsl:window() => ixsl:call('JSON.parse', [ $scrollOptions ]) ])</code>. Seems a bit cumbersome, not sure whether there is a simple way to convert an XdmMap into a JavaScript object inside of Saxon-JS.</p>
</blockquote>
<p>Indeed currently our recommended approach is that if you really want/need to work with JavaScript objects, then create them in the JavaScript space, since converting from XDM maps is not possible. But either: (a) this needs to be made clearer in the documentation; or (b) as Martin alludes, perhaps we should actually be providing a way to ask for (certain) XDM maps to be converted to JavaScript objects from the XSLT (e.g. with a new IXSL function).</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>