Project

Profile

Help

Bug #5338 ยป Re_ [SaxonJS - Bug #5338] XX Compiler reports _Unknown accumulator NNNNN_ when an accumulator-before or -after call occurs in a global variable - 2022-02-25T14_17_43Z.eml

Alexander Stein, 2022-02-25 15:17

 
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 MAwrG/PkGGIeXgAAJzdhvw
for <dropbox@plan.io>; Fri, 25 Feb 2022 15:17:23 +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.138 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.138 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="p1eDPfFG";
dkim-atps=neutral
Received: from GCC02-BL0-obe.outbound.protection.outlook.com (mail-bl2gcc02on2138.outbound.protection.outlook.com [40.107.89.138])
(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 1DBF183586
for <inbox+saxonica+f38e+saxon-js@plan.io>; Fri, 25 Feb 2022 15:17:23 +0100 (CET)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=caJV2u2LMRfm6ptaA15ZPo22jBxbJhZTMdv0gJtXS6l4QuzB1NdBDZ/Iu2OHgECG8UqmvADswaQvprazWSfZWW1lob9U+l6N6Tmc7YbStzTvW1bRDrIJ/95zHCPvkTCXzzG+4yHL0WpTZjGJFpJBo6D4XtpcfN7et6vB7KdYWpfOmnOMIGnVW8DvKZFwWsNDUX5Wv/s6PcnX8j9LjAqniBOVWuu1WJ/HGcndJn6z5mMO70wmLio4RuFjltNpL213jueMc73tmvqq9P4Vxxb+C9E4yChpATzYRPAiC6/5iWSDTK1HELJj4tzJWlpOlgb5hkNk1V4+lF+c+yK9CqsrXw==
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=vpNE7CzzBUf9arF4jQNQ+/Dlcnl/h9AZODkneXKdFyo=;
b=KNdFF6NmAjnGDxIL2GqAf5zG5aPqoGJsSlGiZTCL872fCKhC67btMc2UTxY99OUTiUeekJQZkIDYelwYXEzsFh9vmJxwtHc2qdP9LR9Z7SgvzyLkHr5vXL5DfhxbdOHZkl+cGcZZoOXZyuCUQ3qd/pYd1LDE2OgZn9J7+bc8WFB14QcjJiPTWB0BWO4Mq5SqQTNO075Q5318xlhjW9u9SIsmcJtwEo7tTngGO0n9jwC2SiLOGqE1NZLeqiN9vyvnKAs7JQIiJvuJ6Cz9TIp3S1DWiJ1NqZ03HBNik5qEXadsp/lKjiFL+KAE+fpVugKBG28/pyHsdkmG0tz7qWNybQ==
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=vpNE7CzzBUf9arF4jQNQ+/Dlcnl/h9AZODkneXKdFyo=;
b=p1eDPfFG28titc16GaKvct6CbDSAzKNY6+zDbosFnSdPjGfjAxmyMcLQTsBSFXTQtzWbaZ6U6UoTlahUwjU/jcqPOPzvcsoihfPDJk8MUUbrlb0hmQvEiAJPYunGDQhw6VwhV2Pa63x0lv9+ksqPDgG0osUpI/ryJKfov1Rd6bM=
Received: from DM6PR09MB4726.namprd09.prod.outlook.com (2603:10b6:5:263::9) by
DM6PR09MB5335.namprd09.prod.outlook.com (2603:10b6:5:26e::13) 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:17:19 +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:17:19 +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] XX Compiler reports "Unknown accumulator
NNNNN" when an accumulator-before or -after call occurs in a global variable
Thread-Topic: [SaxonJS - Bug #5338] XX Compiler reports "Unknown accumulator
NNNNN" when an accumulator-before or -after call occurs in a global variable
Thread-Index: AQHYKlJCJr/+iGEQwk6B96X4pnu6/w==
Date: Fri, 25 Feb 2022 14:17:19 +0000
Message-ID:
<DM6PR09MB47267BE19D3F3A8E53475AAA8D3E9@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: 3f8d49d0-d0fb-b6e9-f66b-830c98094495
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: 148f7537-81c6-48cb-3505-08d9f86988b7
x-ms-traffictypediagnostic: DM6PR09MB5335:EE_
x-microsoft-antispam-prvs:
<DM6PR09MB53357C4D16B380C425BC836E8D3E9@DM6PR09MB5335.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:
/dHJUsMJ1hgoUmmfaoeN7r5qr/S4lhPXfWLdXALfxE0Q867PD1S+R/Rju0gYVnpiJfRTQp5B1SO8CNwlj6wN/xzDTsgc7vhEU6NZl3loBWJvelFCW2Nnv6GLkHcIr/c9ksB1AaSn7ucYllClrrowrIy3tifDhVhHqD9GXPVD8P2OL55v9kX3U1dMaVXyzeCZlrwIaLeR3mRVyhOJCD8sda+N6bvAm6qQYrmQdEEo2cDkPgg0WkPfLviPYRxHgWbE2M8C0HdFtLjT/7WAEUfvmATCPPOnTv9RU7OJmJAOnaU6ORri03xaLL+6tQCE8D0xYnjkkp6LgldyLlPSBwcYdl+a/fUuqJRZJg8n9VgQ7vNI322Y9SlaGQ5v9RBMRdsyt8k/oAhCJr/VbmzgrbLheqkok8gRYgZxx9+hwUi+Xgl8jatkWs3lRxBI+BEewtJ3OUjWdie1w49dc94WAxpwx+WkkT7JVxo55nUVrqa8YYUg8xFljV2p/bfXDXuO1r+F3dIWPSQ4n1RWHAaGvsjyRef+i1rla9CVkhH93K0spWbr3nmheVpOHfwVUUtEYj1XRNvIQA5be3agO30VHukxuXrzmlE37OiWsh1iqJkOzK5KVyGuNoHSdihFTA/cWLQnVIH8lpB1Bmjtqi44EcfUQ6Pa+kjKg9PKbJXvn/iTc4yjdfu2ZSMGgC+RUQPQe6xbHowbqF/XgD8p30oz8DJ4j0QZYo8GueX+UoMAVVT8o7TWP+NrLzsNduI7sUxa57Lu0HtMZudBHmB7B7e8h70K5r7y4PAR756dtYXr+ZauvEN6flIj9fGOZ4W3ndtjbURR
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)(33656002)(966005)(38070700005)(7696005)(9686003)(6506007)(316002)(53546011)(86362001)(5660300002)(52536014)(8936002)(66476007)(66446008)(2906002)(186003)(83380400001)(8676002)(55016003)(4326008)(64756008)(71200400001)(166002)(122000001)(91956017)(82960400001)(66946007)(38100700002)(66556008)(76116006)(107886003)(19627405001)(508600001)(585924005);DIR:OUT;SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0:
=?iso-8859-1?Q?UBFBSH3faCx0pPTcD/uBBRnpMcm122qoOrxOTAWsQnqRB/n5yUgNqIDDGm?=
=?iso-8859-1?Q?cz/+7o0FFa6y8cLXvh31sfrFbepnFJeWsoLNEfi/4I675/GO2vN+ZaeWRf?=
=?iso-8859-1?Q?gMnW037md9vyrl4DBbCkoFTiHHzz2X/G43VaofhDuae2Fgv4w2/9YHk6R4?=
=?iso-8859-1?Q?InPRMSyVUwf2LfT6gEkCCbuEC551cR4u05fNuO+KH3CXD3EfMyLHYmX9a3?=
=?iso-8859-1?Q?P+CbXsmNaiHM/s+iOau+M/zrf09jn1PAHp2K0l6ckrxKwQuU7q5EaSeJpX?=
=?iso-8859-1?Q?4CQVkTHzaiJTf+FrRaqXFm5oZRS8uJH3GumcvP7pAj1Nr8Yz+EjnzErt9Q?=
=?iso-8859-1?Q?QseA1uJYsJlHoXg6vX/gukWq332lzRbOty+zG+0d/ubtJp1RYZnURqvQTp?=
=?iso-8859-1?Q?OONS8NbqELBu9375X0D5NBC3KXbUxCrfcTneQ8+XX3dCFLCqfWMYA3BZ76?=
=?iso-8859-1?Q?lekitvjO0g6ynklKZY4FRmoI8IqG6vRI0VgDmtCZ/lxl0L0GZdWNrbZU+2?=
=?iso-8859-1?Q?BsF3zF6ulViVlhBWEQtQJosEjmtAivrhc1Z42VJBypq72GXvgNfpeMT38M?=
=?iso-8859-1?Q?uZqECdFoKAShQJLiuZLfGUuuP7f1+7/bminDFNC+wQcqQ2tv0RG2Taj12R?=
=?iso-8859-1?Q?8aQyx9YWfue6O+ONWwxk6+nt7uKBrAPZnNLhEDh3s6uvhDMnVsNXYruVQx?=
=?iso-8859-1?Q?ekatA/OmSv6aj7iNd/KjQfX/0jDvW5PUuY3G90IddCSW6G0mio4kMI82Fi?=
=?iso-8859-1?Q?AnabWEdyOWiM7FhYUyjW4QzYe7appOJQzAAFFbhnVvA9EF2/DmY23URfFx?=
=?iso-8859-1?Q?KFLATgn2fXce2J4CFUbj6jGVeFjWKTXMazGI1UMwZE4FDGMlNXz2HXYFqs?=
=?iso-8859-1?Q?eEGWPL4+QWV6/v/CB3yqOlvnoPpEy1m+YJfIfI2W1yvRHXe/lMDv835arZ?=
=?iso-8859-1?Q?oovIoXheixtw/JLKVN2VPxryJeWzN40h5bz7Z+77eiQgqRivXGXP1BJQ8A?=
=?iso-8859-1?Q?vocHgx5Rdk9w9j3BSRQnC7fEnrABk5ApDfgK46wO9qMKlvRSZOgx0sGA1s?=
=?iso-8859-1?Q?OKVN/wjoAQ480AvjDlgkPJxNBaN6g11bie1GlM3CJH6r0hcDBplPaNzfg0?=
=?iso-8859-1?Q?9c0FKhiinBfwPLoegw36FBzR1uXW6udE4N1p2Gcjm/HMFh4nB7ky/TemZG?=
=?iso-8859-1?Q?SVmbTLukKZmTfKe3wy0/TRISUBNeBOoQR9efjSIp1WFR/RvFsgEVTT0oiV?=
=?iso-8859-1?Q?OCsJFHRDSrD3MSzMeh1A8IYT1lKgMlHIVkxqp2+THoNSn0yR5HHV5TlPEX?=
=?iso-8859-1?Q?OKQR/Wwf3Sq2QLqordGiMMV5USqo62hRQUMPoJ8Ha4+N9s0lFWO+26QcY0?=
=?iso-8859-1?Q?aHXiSoGXDj?=
Content-Type: multipart/alternative;
boundary="_000_DM6PR09MB47267BE19D3F3A8E53475AAA8D3E9DM6PR09MB4726namp_"
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: 148f7537-81c6-48cb-3505-08d9f86988b7
X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Feb 2022 14:17:19.7348
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 2ab5d82f-d8fa-4797-a93e-054655c61dec
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR09MB5335

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

Also, thanks for this feedback on the transforms. I will definitely want to=
sync up with the team to address these as well, I need their feedback to u=
nderstand the original code (not repro) and the implications of b better. W=
e will follow up soon enough.


________________________________
From: Saxonica Developer Community
Sent: Friday, February 25, 2022 8:14 AM
Subject: [SaxonJS - Bug #5338] XX Compiler reports "Unknown accumulator NNN=
NN" when an accumulator-before or -after call occurs in a global variable


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

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

A couple of observations:

(a) you may be able to work around the problem by moving the accumulator-af=
ter call so it is not in a global variable, or by changing the argument to =
accumulator-after so it is not a string literal (e.g use a global parameter=
)

(b) It's probably rather inefficient to use an accumulator like this, if yo=
u only want the value at the end of the document. That's because the curren=
t accumulator value will potentially be stored on every node in the tree. C=
omputing it conventionally using template rules with a special mode, or usi=
ng xsl:iterate or fn:fold-left(), would probably perform better.

________________________________
Bug #5338: XX Compiler reports "Unknown accumulator NNNNN" when an accumula=
tor-before or -after call occurs in a global variable<https://saxonica.plan=
.io/issues/5338?pn=3D1#change-19660>

* Author: Alexander Stein
* Status: In Progress
* Priority: Normal
* Assignee: Michael Kay
* Category: XX compiler
* 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_DM6PR09MB47267BE19D3F3A8E53475AAA8D3E9DM6PR09MB4726namp_
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);">
Also, thanks for this feedback on the transforms. I will definitely want to=
sync up with the team to address these as well, I need their feedback to u=
nderstand the original code (not repro) and the implications of b better. W=
e will follow up soon enough.<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:14 AM<br>
<b>Subject:</b> [SaxonJS - Bug #5338] XX Compiler reports &quot;Unknown acc=
umulator NNNNN&quot; when an accumulator-before or -after call occurs in a =
global variable
<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-19660" =
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>A couple of observations:</p>
<p>(a) you may be able to work around the problem by moving the accumulator=
-after call so it is not in a global variable, or by changing the argument =
to accumulator-after so it is not a string literal (e.g use a global parame=
ter)</p>
<p>(b) It's probably rather inefficient to use an accumulator like this, if=
you only want the value at the end of the document. That's because the cur=
rent accumulator value will potentially be stored on every node in the tree=
. Computing it conventionally using
template rules with a special mode, or using xsl:iterate or fn:fold-left()=
, would probably perform better.</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-19660" target=
=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" style=
=3D"color:#0088b7; text-decoration:none">Bug #5338: XX Compiler reports &qu=
ot;Unknown accumulator NNNNN&quot; when an accumulator-before
or -after call occurs in a global variable</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>In Progress</li><li><strong>Priority: </strong>Normal</li><li><strong>As=
signee: </strong>Michael Kay</li><li><strong>Category: </strong>XX compiler=
</li><li><strong>Sprint/Milestone: </strong></li><li><strong>Applies to JS =
Branch: </strong>2</li><li><strong>Fix Committed on JS Branch: </strong></l=
i><li><strong>Fixed in JS Release: </strong></li><li><strong>SEF Generated =
with: </strong></li><li><strong>Platforms: </strong></li><li><strong>Compan=
y: </strong>Fed</li><li><strong>Contact person: </strong>Alexander J. Stein=
</li><li><strong>Additional contact 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-19660">
<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_DM6PR09MB47267BE19D3F3A8E53475AAA8D3E9DM6PR09MB4726namp_--
    (1-1/1)