Project

Profile

Help

Bug #5338 ยป Re_ [SaxonJS - Bug #5338] Discrepancy between behavior and standard conformance with accumulator-after in SaxonJS and Saxon HE (Java) - 2022-02-25T14_16_09Z.eml

Alexander Stein, 2022-02-25 15:16

 
X-He-Spam-Score: -2.2
Return-Path: <alexander.stein@nist.gov>
Delivered-To: dropbox@plan.io
Received: from m.launch.gmbh ([127.0.0.1])
by m.launch.gmbh with LMTP id 6Fw1DZDkGGJCWgAAJzdhvw
for <dropbox@plan.io>; Fri, 25 Feb 2022 15:15:44 +0100
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on m.launch.gmbh
X-Spam-Level:
X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,
DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DMARC_PASS,FROM_GOV_DKIM_AU,
HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,
SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no
version=3.4.2
X-Spam-Report:
* -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at
* https://www.dnswl.org/, no trust
* [40.107.89.90 listed in list.dnswl.org]
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
* [score: 0.0000]
* -0.1 DMARC_PASS DMARC check passed
* -0.1 SPF_PASS SPF check passed
* -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2)
* [40.107.89.90 listed in wl.mailspike.net]
* -0.0 SPF_HELO_PASS SPF: HELO matches SPF record
* 0.0 HTML_MESSAGE BODY: HTML included in message
* 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily
* valid
* -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature
* -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from
* author's domain
* -0.0 FROM_GOV_DKIM_AU From Government address and DKIM signed
* -0.0 T_SCC_BODY_TEXT_LINE No description available.
* -0.0 DKIMWL_WL_HIGH DKIMwl.org - High trust sender
X-Spam-Score: -2.2
Envelope-to: inbox+saxonica+f38e+saxon-js@plan.io
Authentication-Results: m.launch.gmbh; dmarc=pass (p=reject dis=none) header.from=nist.gov
Authentication-Results: m.launch.gmbh; spf=pass smtp.mailfrom=alexander.stein@nist.gov
Authentication-Results: m.launch.gmbh;
dkim=pass (1024-bit key; unprotected) header.d=nist.gov header.i=@nist.gov header.b="pJMPQB/J";
dkim-atps=neutral
Received: from GCC02-BL0-obe.outbound.protection.outlook.com (mail-bl2gcc02on2090.outbound.protection.outlook.com [40.107.89.90])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by m.launch.gmbh (Postfix) with ESMTPS id 5951983586
for <inbox+saxonica+f38e+saxon-js@plan.io>; Fri, 25 Feb 2022 15:15:41 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=cPnRsOAsK1hmjbZP1C/JP6cS8rOhO40eblMaFeOY7c7VkqikKIZ3meZZX6mQgt4GacQI+eT3oIogAg7zEgqmty8MhTpnzo7WoCCss/2KTwy8rhWKaFk68dXjgayRP46742P4w22bjolqpY9+46Sx2VIqJEYYosZ1JWkQ568D1NZhg+w+fM11gPQdc3eTPYSBroz9b9iib7Km/2qVPHwLrplXy7U7eoaPOMUXy5C5ynHAMAEIBZRXFIDS2nS/5Xoqhr+QcPi77sBGhyCRMvskHLdz4u+bVqwSBR3JQMMtT4djguv3jTCzNPwnp4WuUxw81COQ1ppJMYpbGjfd/mo+xQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;
bh=DR5qOod9XvRIlURNGUfvRGuqMxbt5OhhN83vqXXj4Ac=;
b=DvRJUKu3pxqp59sw3uUDRJBoZ7UFbUCvHhvkBTIPdjYHvGul8NQnhGQSJBxtqJ1x2IsU01himLXCNyhjzS+N9BZAGVH3vtQXhIDjxdejTg5VQy74ZB03MV3rVwbb1nDOMa0aW7Io3TFMUAYp+PoEALYKtDdS37Zjsdu63MjQ6C7HYvPX9/XA2WvfaMvp1CYCNDXUIPdSjq3bVE/N1c2A1AWqPYT/3RJuGXbPnZ6r6ya32WsbZIwIrQMz84U8dx4hFpjjy8P+EMhmFRoENc0juW886qjtgopFkXAKeuEMaZJMhSlTcLnIvQ7LYKjshRbes+i/Z9l+NtbL0BMj2KikvA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=nist.gov; dmarc=pass action=none header.from=nist.gov;
dkim=pass header.d=nist.gov; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nist.gov; s=selector2;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=DR5qOod9XvRIlURNGUfvRGuqMxbt5OhhN83vqXXj4Ac=;
b=pJMPQB/J5Luvf+zJodRuHtlJqLMW6q4LAKxw6jULrO6sIcmvvstNX8SSLFcTQyUn45YbAVkzLkKAWHHxGTZl5T0EtBRTZ7TbDW90DgcRXNhxQN9WhCGxCJgqYMNFr0zwxr01HjGqAWz4Ahu2IrkA3x21/Sp566uw0NeMD3a3CO8=
Received: from DM6PR09MB4726.namprd09.prod.outlook.com (2603:10b6:5:263::9) by
DM6PR09MB5286.namprd09.prod.outlook.com (2603:10b6:5:26b::10) with Microsoft
SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
15.20.5017.22; Fri, 25 Feb 2022 14:15:38 +0000
Received: from DM6PR09MB4726.namprd09.prod.outlook.com
([fe80::193e:1078:96fb:ea8]) by DM6PR09MB4726.namprd09.prod.outlook.com
([fe80::193e:1078:96fb:ea8%4]) with mapi id 15.20.5017.026; Fri, 25 Feb 2022
14:15:38 +0000
From: "Stein, Alexander J. (Fed)" <alexander.stein@nist.gov>
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon-js@plan.io>
CC: "Piez, Wendell A. (Fed)" <wendell.piez@nist.gov>
Subject: Re: [SaxonJS - Bug #5338] Discrepancy between behavior and standard
conformance with accumulator-after in SaxonJS and Saxon HE (Java)
Thread-Topic: [SaxonJS - Bug #5338] Discrepancy between behavior and standard
conformance with accumulator-after in SaxonJS and Saxon HE (Java)
Thread-Index: AQHYKlIH8DQauFYcy0K5C7X2jEBkmg==
Date: Fri, 25 Feb 2022 14:15:38 +0000
Message-ID:
<DM6PR09MB47266304489F8DD642E27F508D3E9@DM6PR09MB4726.namprd09.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
suggested_attachment_session_id: 1a84fd7c-3c18-6a16-c94d-8ed6ce8e71b8
authentication-results: dkim=none (message not signed)
header.d=none;dmarc=none action=none header.from=nist.gov;
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: d65bdf15-5c67-430f-9651-08d9f8694c73
x-ms-traffictypediagnostic: DM6PR09MB5286:EE_
x-microsoft-antispam-prvs:
<DM6PR09MB52860BCC811DB5ECA62901BA8D3E9@DM6PR09MB5286.namprd09.prod.outlook.com>
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info:
HBq29S8bpJ8byOKtLyP3mPF78zr4DDooja/JJWP4fl/hjIk5MfMzE9Z1OHdD2gVIl//I2/twDbMlEp2n7ddwYAtBIpUx760ifx4l0kdsKc4u/9QJSiKswfWBcD+KRmFgPblFuaut0SK0+b3Mulo35Fm2QFT1Eoa+Ws2MWFFpvRTMhRuSqsEeMipvnt17MHSAX/DC3s9q+QaRVTUVLTVo2K4Aqj7cO4HN71n+GnonjdLOpTTTSWGNaWy0MCdBG4q7c4l4tHg1pQD3om7OK87WJYWwwfBVgFPO8/Se9wJKnj9BuKqPh/JpwDTLzoL5epkV0CfU4dGwTvCE04nZto2zTCpG9WJabCwBsEzJq/1S5k1FTEHtcZmPM/oRKP4EFC8RyEXIYt33MobHwLKmmkDlLYGi1TA51ofWeTJTosdGY29EoIStJ3vEzFMP8a2/k3IlgaBpPQxIEfWrnpqwGmYaxf7sdvwOGuA+iz6X2apO7R9k2nSECduuynQJkDu44SkQ7sg3JULmMTBUbZ/fOKjmr8hGOIlqh1NULHo2RfcSwB+eQeL90VxnzlIa1i8h7A68G+e34DHk+fZ2RzbAABIj6L8P7GsJo2GroP16Fa3w77yKX5WeL656jEhwuCWm4E39gYDMip3M0qClC5i0DnCMI3ZYvlOqvPpfy+4yL8jlos8amackxvIG0ReotHW7alYp1BmYJnBEG03O69EPSM5OEW8BepOqWCv0xDq1XOfVlbY9/1/Efzkrm3y+qV1oGkqQal+cqgHS3o4Ye8y9loBND4FFmeh4J63s7Z0SuFoddXuzyaLCEV7G6qDzsgA8Tubd
x-forefront-antispam-report:
CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR09MB4726.namprd09.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(4326008)(91956017)(19627405001)(52536014)(966005)(55016003)(76116006)(66946007)(66556008)(66446008)(66476007)(64756008)(186003)(107886003)(8936002)(5660300002)(166002)(316002)(6506007)(508600001)(53546011)(7696005)(122000001)(82960400001)(38100700002)(83380400001)(38070700005)(71200400001)(86362001)(33656002)(9686003)(2906002)(585924005);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
=?iso-8859-1?Q?BuQ9ooH9dTJL0yVkjmb1iXkHb/FvlWfb2rqoa1LaIz6s8QOwbNhbQhMs8W?=
=?iso-8859-1?Q?HzIDQXAjM9ErujvvDw2mvPx8IUYiHJQGIAtCzPjpaTTS4yK4Ubq4lM2qsc?=
=?iso-8859-1?Q?dzjWrnPWYVcPi5cYYAXWb+7EsODAMdkWNGcqjwaUVpqqKqI6Ni5zDgZJjB?=
=?iso-8859-1?Q?BQKQaLGlc5ogBKWgSq634yR0xtjTb2Vx70rP/l18PMZC+c+09dZauSTkzv?=
=?iso-8859-1?Q?7povvPhqw+icrL8Wub6vNKuj/XQYOWaI2XFnQduyvBiowXfPeSQFqNICEX?=
=?iso-8859-1?Q?qCS09r1JaISQQV4b9QalaRZK+ua/1v5YlYoIUTbBwmmFOww5DHXITZa6Aj?=
=?iso-8859-1?Q?QbaNjrB4cpffsJ83oLdsp/m+FoQXpiPquZpgk3j0euQiHmrlEBl6fMCLdj?=
=?iso-8859-1?Q?hb0/heu9VuVRNObSuqQiy5bK9RCANjHuVXTiDhfueSa9HXrkpsKk/IDPPt?=
=?iso-8859-1?Q?gRjFcQnKibl3rgKX4AkSclpBbLG5W162UA+/9UKKFs5+Qsy6/LF0SjzBir?=
=?iso-8859-1?Q?BCUxcjil5442XOSW/GGGbkP5MfyiK4oU7svnIsRMWL/yNinNnGaRIUaj8t?=
=?iso-8859-1?Q?AzePyhTBd+S0mZisWK2ruOwOy7S55vD08u2LCfsQuuUhwMkliKWGoGZKKQ?=
=?iso-8859-1?Q?15teZOQe+tujurogdvljceEKGTqMdGdWqwFLPiAjJHgHW7RSkXJ4n7l4JA?=
=?iso-8859-1?Q?jW8mX2lH0HHZ63VLl3U2Rer/f0J3hgZfZgRr/1VY8iiRcIzpJnx6iVYZxf?=
=?iso-8859-1?Q?M+h3p1Tup+TDhlwjhWUV2/RipoqonvKC/n8ahJTb2MCHF5oGKdqokYigyt?=
=?iso-8859-1?Q?r7ljqTp1C8gP+cdrsuYdQXaFnnukAQkHmoINGKLo3SznEpI6kBhK9EXNsU?=
=?iso-8859-1?Q?dP8GUUH+4NizYuPcD/sQpy3+jLVxm3GgRGOzAOr8yBUQ5KCdT3v6/+5mDG?=
=?iso-8859-1?Q?nzalGJiby1tbmFQ8VtfOOHCnrrARlMrd8wZ2xZC8GvQQc/E5cpcsqI4P7m?=
=?iso-8859-1?Q?ClNNZvROhhMS0jPWNkwpIHNGUdmfBqxJqcnHxLavJVLV+Wt4d7MMl10bM4?=
=?iso-8859-1?Q?TjA8CPIuQBsytvwyVcyDwTrRKa+6EfqwYoKbJjAn5PtmlxODIQDCUY3han?=
=?iso-8859-1?Q?87J6jzbifRyypYid1VD1mj7M5oa+wBwaGpOG8U3/UKtnVF5YtHLXr5cjoB?=
=?iso-8859-1?Q?coXoXOJTjMoOPYUTQrfP4XSCvLbWSO6znkf1WZ1tkIXTSOWMUwR8gJ90Bc?=
=?iso-8859-1?Q?jo9s6EAvWYjzHvJJhEL93NP7kJIcPqSXJvRyVutEd1HPI04gUtsmZk/TxQ?=
=?iso-8859-1?Q?WpZ8Xd7x1MzUkz1rl29DpPrwuf2ZALzU4Mtlbx9YdSFz1sKfcJJUc46msy?=
=?iso-8859-1?Q?Jp9RuBwHdc?=
Content-Type: multipart/alternative;
boundary="_000_DM6PR09MB47266304489F8DD642E27F508D3E9DM6PR09MB4726namp_"
MIME-Version: 1.0
X-OriginatorOrg: nist.gov
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DM6PR09MB4726.namprd09.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: d65bdf15-5c67-430f-9651-08d9f8694c73
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2022 14:15:38.6440
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 2ab5d82f-d8fa-4797-a93e-054655c61dec
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR09MB5286

--_000_DM6PR09MB47266304489F8DD642E27F508D3E9DM6PR09MB4726namp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

OK, thanks Michael. I will evaluate this approach in the context of our cod=
e base once I sync up with the team, and more quickly in the same reproduct=
ion library of course.

I will follow up in the next few days.


________________________________
From: Saxonica Developer Community
Sent: Friday, February 25, 2022 8:06 AM
Subject: [SaxonJS - Bug #5338] Discrepancy between behavior and standard co=
nformance with accumulator-after in SaxonJS and Saxon HE (Java)


--- In your reply, please do not write below this line ---

Issue #5338<https://saxonica.plan.io/issues/5338?pn=3D1#change-19658> has b=
een updated by Michael Kay.
________________________________

I note that the call on accumulator-after() succeeds if we convert <xsl:var=
iable name=3D"total-items-count"> to be a local variable rather than a glob=
al variable.

So I think that the problem might be that at xpath.xsl#196 when processing =
global variables, we aren't passing the tunnel parameter $accumulators thro=
ugh.

This seems to fix it. Solution: in the binding of variable $typed-globals a=
t xpath.xsl#196, add:

<xsl:with-param name=3D"accumulators" tunnel=3D"true" select=3D"$accumulato=
rs"
use-when=3D"not($COMPILE_GLOBAL)"/>


Note in passing: the code here is over-complex because it includes multiple=
options for configuring the compiler, as a results of experiments to impro=
ve performance. We ought to decide which of these options we are actually u=
sing, and get rid of the code for the paths that are dormant.

________________________________
Bug #5338: Discrepancy between behavior and standard conformance with accum=
ulator-after in SaxonJS and Saxon HE (Java)<https://saxonica.plan.io/issues=
/5338?pn=3D1#change-19658>

* Author: Alexander Stein
* Status: New
* Priority: Normal
* Assignee:
* Category:
* Sprint/Milestone:
* Applies to JS Branch: 2
* Fix Committed on JS Branch:
* Fixed in JS Release:
* SEF Generated with:
* Platforms:
* Company: Fed
* Contact person: Alexander J. Stein
* Additional contact persons:

Hello, we have a pipelines and software using Saxon HE (Java) variant and t=
he SaxonJS variant with NodeJS to build CLI tooling. We have encountered a =
problem in which running Saxon HE will process a collection of XSL transfor=
ms in shell scripts (running Saxon HE 9.x and/or 10.x) and successfully exe=
cute. Developers wrapping compiling those same transforms into SEF artifact=
s receive compilation failures.

https://github.com/usnistgov/metaschema/issues/180

We receives exceptions like this only with SaxonJS.

Failed to compile stylesheet: Static error in XPath on line 17 in fixtures/=
accumulator_simple.xsl {accumulator-after('total-items')}: Unknown accumula=
tor Q{}total-items
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
Static error in XPath on line 17 in fixtures/accumulator_simple.xsl {ac=
cumulator-after('total-items')}: Unknown accumulator Q{}total-items
Failed to compile stylesheet: Static error in XPath on line 27 in fixtures/=
accumulator_basic.xsl {accumulator-after('total-items')}: Unknown accumulat=
or Q{}total-items
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
Static error in XPath on line 27 in fixtures/accumulator_basic.xsl {acc=
umulator-after('total-items')}: Unknown accumulator Q{}total-items
Failed to compile stylesheet: Static error in XPath on line 28 in fixtures/=
accumulator_namespaces.xsl {accumulator-after('example:total-items')}: Unkn=
own accumulator Q{https://example.com/ns/custom/0.1}total-items
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
Failed to compile stylesheet:
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963
Static error in XPath on line 28 in fixtures/accumulator_namespaces.xsl=
{accumulator-after('example:total-items')}: Unknown accumulator Q{https://=
example.com/ns/custom/0.1}total-items


We have build a reproduction library here. With or without namespaces (I re=
-read the XSLT 3.0 standard), it is not clear to me if an accumulator requi=
res a unique namespace or not. I built simple reproductions and none of the=
se seem to compile with current SaxonJS from NPMJS. Instructions to reprodu=
ce in the repo below.

https://github.com/aj-stein-nist/issue180example.git

Let me know if this is my misunderstanding of syntax for accumulators, whet=
her SaxonJS is working as intended, or whether Saxon HE is working as inten=
ded. Similar code compiles with Saxon as intended. Thanks.

________________________________

You have received this notification because you have either subscribed to o=
r are involved in a project on Saxonica Developer Community site. To change=
your notification preferences, please click here: https://saxonica.plan.io=
/my/account?tour=3Dmail_preferences

This notification was cheerfully delivered by<https://plan.io/>
[Planio]<https://plan.io/>

--_000_DM6PR09MB47266304489F8DD642E27F508D3E9DM6PR09MB4726namp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
OK, thanks Michael. I will evaluate this approach in the context of our cod=
e base once I sync up with the team, and more quickly in the same reproduct=
ion library of course.
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Arial, Helvetica, sans-serif; font-size=
: 12pt; color: rgb(0, 0, 0);">
I will follow up in the next few days.<br>
</div>
<div>
<div><br>
</div>
<div style=3D"font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12p=
t; color:rgb(0,0,0);">
<br>
<hr tabindex=3D"-1" style=3D"display:inline-block; width:98%;">
<b>From:</b> Saxonica Developer Community<br>
<b>Sent:</b> Friday, February 25, 2022 8:06 AM<br>
<b>Subject:</b> [SaxonJS - Bug #5338] Discrepancy between behavior and stan=
dard conformance with accumulator-after in SaxonJS and Saxon HE (Java)
<div><br>
</div>
</div>
<div class=3D"rps_f6f7">
<div style=3D"font-family:&quot;ProximaNova-Regular&quot;,Helvetica,Arial,s=
ans-serif; font-size:14px; line-height:1.4em; color:#333434">
<table class=3D"x_planio_mail" style=3D"border-collapse:collapse; margin-bo=
ttom:1em; border:1px solid #bbb; padding:4px; border-spacing:0; margin-bott=
om:0; width:100%; border:none; padding:0" width=3D"100%" cellspacing=3D"0" =
cellpadding=3D"0">
<tbody>
<tr>
<td class=3D"x_planio_mail x_header" style=3D"border:1px solid #bbb; paddin=
g:4px; text-align:center; width:100%; font-family:MarketWeb,Helvetica,Arial=
,sans-serif; font-size:0.8em; color:#D7D7D7; border:none; padding:0">
<p>--- In your reply, please do not write below this line ---</p>
</td>
</tr>
<tr>
<td class=3D"x_planio_mail" style=3D"border:1px solid #bbb; padding:4px; bo=
rder:none; padding:0">
Issue <a href=3D"https://saxonica.plan.io/issues/5338?pn=3D1#change-19658" =
target=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" s=
tyle=3D"color:#0088b7">
#5338</a> has been updated by Michael Kay.
<hr style=3D"width:100%; height:1px; background:#ccc; border:0; margin:1.2e=
m 0">
<ul class=3D"x_journal x_details" style=3D"color:#959595; margin-bottom:1.5=
em">
</ul>
<p>I note that the call on accumulator-after() succeeds if we convert <code=
style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot;,Couri=
er,monospace; font-size:85%; background-color:#ececec; word-wrap:break-word=
; border-radius:3px; padding:0.2em; margin:0">
&lt;xsl:variable name=3D&quot;total-items-count&quot;&gt;</code> to be a lo=
cal variable rather than a global variable.</p>
<p>So I think that the problem might be that at xpath.xsl#196 when processi=
ng global variables, we aren't passing the tunnel parameter
<code style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot;,=
Courier,monospace; font-size:85%; background-color:#ececec; word-wrap:break=
-word; border-radius:3px; padding:0.2em; margin:0">
$accumulators</code> through.</p>
<p>This seems to fix it. Solution: in the binding of variable $typed-global=
s at xpath.xsl#196, add:</p>
<pre style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot;,C=
ourier,monospace; font-size:85%; background-color:#ececec; word-wrap:break-=
word; margin:1em 0; padding:8px; border:none; border-radius:3px; width:auto=
; overflow-x:auto; overflow-y:hidden"><code style=3D"font-family:Hack,Conso=
las,Menlo,&quot;Liberation Mono&quot;,Courier,monospace; font-size:85%; bac=
kground-color:#ececec; word-wrap:break-word; border-radius:3px; padding:0.2=
em; margin:0; padding:0">&lt;xsl:with-param name=3D&quot;accumulators&quot;=
tunnel=3D&quot;true&quot; select=3D&quot;$accumulators&quot;=0A=
use-when=3D&quot;not($COMPILE_GLOBAL)&quot;/&gt=
;=0A=
</code></pre>
<p>Note in passing: the code here is over-complex because it includes multi=
ple options for configuring the compiler, as a results of experiments to im=
prove performance. We ought to decide which of these options we are actuall=
y using, and get rid of the code
for the paths that are dormant.</p>
<hr style=3D"width:100%; height:1px; background:#ccc; border:0; margin:1.2e=
m 0">
<h1 style=3D"font-family:&quot;ProximaNova-Bold&quot;,Helvetica,Arial,sans-=
serif; font-weight:normal; margin:0px; font-size:1.3em; line-height:1.4em">
<a href=3D"https://saxonica.plan.io/issues/5338?pn=3D1#change-19658" target=
=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" style=
=3D"color:#0088b7; text-decoration:none">Bug #5338: Discrepancy between beh=
avior and standard conformance with accumulator-after
in SaxonJS and Saxon HE (Java)</a></h1>
<ul class=3D"x_details" style=3D"color:#959595; margin-bottom:1.5em">
<li><strong>Author: </strong>Alexander Stein</li><li><strong>Status: </stro=
ng>New</li><li><strong>Priority: </strong>Normal</li><li><strong>Assignee: =
</strong></li><li><strong>Category: </strong></li><li><strong>Sprint/Milest=
one: </strong></li><li><strong>Applies to JS Branch: </strong>2</li><li><st=
rong>Fix Committed on JS Branch: </strong></li><li><strong>Fixed in JS Rele=
ase: </strong></li><li><strong>SEF Generated with: </strong></li><li><stron=
g>Platforms: </strong></li><li><strong>Company: </strong>Fed</li><li><stron=
g>Contact person: </strong>Alexander J. Stein</li><li><strong>Additional co=
ntact persons: </strong></li></ul>
<p>Hello, we have a pipelines and software using Saxon HE (Java) variant an=
d the SaxonJS variant with NodeJS to build CLI tooling. We have encountered=
a problem in which running Saxon HE will process a collection of XSL trans=
forms in shell scripts (running
Saxon HE 9.x and/or 10.x) and successfully execute. Developers wrapping co=
mpiling those same transforms into SEF artifacts receive compilation failur=
es.</p>
<p><a href=3D"https://github.com/usnistgov/metaschema/issues/180" target=3D=
"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" class=3D"x=
_external" style=3D"color:#0088b7">https://github.com/usnistgov/metaschema/=
issues/180</a></p>
<p>We receives exceptions like this only with SaxonJS.</p>
<pre style=3D"font-family:Hack,Consolas,Menlo,&quot;Liberation Mono&quot;,C=
ourier,monospace; font-size:85%; background-color:#ececec; word-wrap:break-=
word; margin:1em 0; padding:8px; border:none; border-radius:3px; width:auto=
; overflow-x:auto; overflow-y:hidden"><code style=3D"font-family:Hack,Conso=
las,Menlo,&quot;Liberation Mono&quot;,Courier,monospace; font-size:85%; bac=
kground-color:#ececec; word-wrap:break-word; border-radius:3px; padding:0.2=
em; margin:0; padding:0">Failed to compile stylesheet: Static error in XPat=
h on line 17 in fixtures/accumulator_simple.xsl {accumulator-after('total-i=
tems')}: Unknown accumulator Q{}total-items=0A=
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963=0A=
Failed to compile stylesheet:=0A=
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963=0A=
Static error in XPath on line 17 in fixtures/accumulator_simple.xsl {ac=
cumulator-after('total-items')}: Unknown accumulator Q{}total-items=0A=
Failed to compile stylesheet: Static error in XPath on line 27 in fixtures/=
accumulator_basic.xsl {accumulator-after('total-items')}: Unknown accumulat=
or Q{}total-items=0A=
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963=0A=
Failed to compile stylesheet:=0A=
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963=0A=
Static error in XPath on line 27 in fixtures/accumulator_basic.xsl {acc=
umulator-after('total-items')}: Unknown accumulator Q{}total-items=0A=
Failed to compile stylesheet: Static error in XPath on line 28 in fixtures/=
accumulator_namespaces.xsl {accumulator-after('example:total-items')}: Unkn=
own accumulator Q{https://example.com/ns/custom/0.1}total-items=0A=
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963=0A=
Failed to compile stylesheet:=0A=
Error Q{http://www.w3.org/2005/xqt-errors}XTDE3340 at xpath.xsl#963=0A=
Static error in XPath on line 28 in fixtures/accumulator_namespaces.xsl=
{accumulator-after('example:total-items')}: Unknown accumulator Q{https://=
example.com/ns/custom/0.1}total-items=0A=
</code></pre>
<p>We have build a reproduction library here. With or without namespaces (I=
re-read the XSLT 3.0 standard), it is not clear to me if an accumulator re=
quires a unique namespace or not. I built simple reproductions and none of =
these seem to compile with current
SaxonJS from NPMJS. Instructions to reproduce in the repo below.</p>
<p><a href=3D"https://github.com/aj-stein-nist/issue180example.git" target=
=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" class=
=3D"x_external" style=3D"color:#0088b7">https://github.com/aj-stein-nist/is=
sue180example.git</a></p>
<p>Let me know if this is my misunderstanding of syntax for accumulators, w=
hether SaxonJS is working as intended, or whether Saxon HE is working as in=
tended. Similar code compiles with Saxon as intended. Thanks.</p>
<div itemscope=3D"itemscope" itemtype=3D"http://schema.org/EmailMessage">
<div itemscope=3D"itemscope" itemprop=3D"action" itemtype=3D"http://schema.=
org/ViewAction">
<link itemprop=3D"url" href=3D"https://saxonica.plan.io/issues/5338?pn=3D1#=
change-19658">
<meta itemprop=3D"name" content=3D"View Issue">
</div>
<meta itemprop=3D"description" content=3D"View this issue update on Planio"=
>
</div>
</td>
</tr>
<tr>
<td class=3D"x_planio_mail x_footer" style=3D"border:1px solid #bbb; paddin=
g:4px; font-size:0.8em; width:100%; border:none; padding:0">
<hr style=3D"width:100%; height:1px; background:#ccc; border:0; margin:1.2e=
m 0">
<p>You have received this notification because you have either subscribed t=
o or are involved in a project on Saxonica Developer Community site. To cha=
nge your notification preferences, please click here:
<a href=3D"https://saxonica.plan.io/my/account?tour=3Dmail_preferences" tar=
get=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" clas=
s=3D"x_external" style=3D"color:#0088b7">
https://saxonica.plan.io/my/account?tour=3Dmail_preferences</a></p>
</td>
</tr>
<tr>
<td class=3D"x_planio_mail x_planio_footer" style=3D"border:1px solid #bbb;=
padding:4px; text-align:center; width:100%; font-family:MarketWeb,Helvetic=
a,Arial,sans-serif; font-size:1.2em; color:#D7D7D7; border:none; padding:0"=
>
<br>
<div><a href=3D"https://plan.io/" target=3D"_blank" rel=3D"noopener norefer=
rer" data-auth=3D"NotApplicable" style=3D"color:#0088b7; color:#D7D7D7; tex=
t-decoration:none">This notification was cheerfully delivered by</a></div>
</td>
</tr>
<tr>
<td class=3D"x_planio_mail x_planio_footer_logo" style=3D"border:1px solid =
#bbb; padding:4px; text-align:center; width:100%; border:none; padding:0">
<a href=3D"https://plan.io/" target=3D"_blank" rel=3D"noopener noreferrer" =
data-auth=3D"NotApplicable" title=3D"Planio" style=3D"color:#0088b7"><img a=
lt=3D"Planio" style=3D"vertical-align:middle; border:none" width=3D"102" he=
ight=3D"25" border=3D"0" src=3D"https://assets.plan.io/images/planio_logo_g=
ray_204x50.png"></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</body>
</html>

--_000_DM6PR09MB47266304489F8DD642E27F508D3E9DM6PR09MB4726namp_--
    (1-1/1)