|
X-He-Spam-Score: -1.9
|
|
Return-Path: <lou.burnard@retired.ox.ac.uk>
|
|
Delivered-To: dropbox@plan.io
|
|
Received: from m.launch.gmbh ([127.0.0.1])
|
|
by m.launch.gmbh with LMTP id EBMbAxJPimJkRAAAJzdhvw
|
|
for <dropbox@plan.io>; Sun, 22 May 2022 16:56:18 +0200
|
|
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on m.launch.gmbh
|
|
X-Spam-Level:
|
|
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DMARC_NONE,
|
|
HTML_MESSAGE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,
|
|
SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no
|
|
version=3.4.2
|
|
X-Spam-Report:
|
|
* -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1%
|
|
* [score: 0.0000]
|
|
* 0.1 DMARC_NONE DMARC record not found
|
|
* -0.1 SPF_PASS SPF check passed
|
|
* -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3)
|
|
* [129.67.1.165 listed in wl.mailspike.net]
|
|
* 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record
|
|
* 0.0 HTML_MESSAGE BODY: HTML included in message
|
|
* -0.0 T_SCC_BODY_TEXT_LINE No description available.
|
|
* -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders
|
|
X-Spam-Score: -1.9
|
|
Envelope-to: inbox+saxonica+f38e+saxon-c@plan.io
|
|
Authentication-Results: m.launch.gmbh; dmarc=none (p=none dis=none) header.from=retired.ox.ac.uk
|
|
Authentication-Results: m.launch.gmbh; spf=pass smtp.mailfrom=lou.burnard@retired.ox.ac.uk
|
|
Authentication-Results: m.launch.gmbh; dkim=none; dkim-atps=neutral
|
|
Received: from relay17.mail.ox.ac.uk (relay17.mail.ox.ac.uk [129.67.1.165])
|
|
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
|
|
(No client certificate requested)
|
|
by m.launch.gmbh (Postfix) with ESMTPS id BF161801E6
|
|
for <inbox+saxonica+f38e+saxon-c@plan.io>; Sun, 22 May 2022 16:56:17 +0200 (CEST)
|
|
Received: from hub06.nexus.ox.ac.uk ([163.1.154.240] helo=Hub06.ad.oak.ox.ac.uk)
|
|
by relay17.mail.ox.ac.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256)
|
|
(Exim 4.92)
|
|
(envelope-from <lou.burnard@retired.ox.ac.uk>)
|
|
id 1nsn0D-0000JY-3Y
|
|
for inbox+saxonica+f38e+saxon-c@plan.io; Sun, 22 May 2022 15:56:17 +0100
|
|
Received: from GBR01-LO2-obe.outbound.protection.outlook.com (104.47.21.56) by
|
|
smtp.nexus.ox.ac.uk (163.1.154.240) with Microsoft SMTP Server (TLS) id
|
|
14.3.498.0; Sun, 22 May 2022 15:56:16 +0100
|
|
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
|
|
b=EVip7PO0g4HzYOJRYlVw9yVOV2jlx4EJxJqqRuBI2hrnHdtnx2aNeIzSSRDDxVMlNum83F6XTXePA3vb0rA7dMPMHkS79MYLUNsHRCBu5+NUCJiai5benzZ09zb2bAmrnPaMxQPEpLS8XnKZ8/g5PtKxrWGQYuXn8xSrnFqu296ccfpYCgMl9TCbLkqKlLWopl39qt7imtjmyYQ7uW5HWOoiQEE36eYRUwvX2eVexHxw4m4V43Rl0fE9tFSU7LuwZD0HmCfxY2d0TnMccETj3IU2zbixyL6uLo41/C9BMjl6247OksRcxQtLZO+RwBSrdNqKbqaeoq9s+thaEt5ouQ==
|
|
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=UdLTEuoUN4xsmTWFPt4uHz2KAgu/JPniBdo7i42YIT0=;
|
|
b=TXJdGEly3nG2HtGyDOa2dFzxnW3Y+hkFX3t1PDrAsSW0KbfTU4lNkfJ9yHTgpSeUt1Dms/LTzt5lMREPkTB0pGP0l+j6usKCg0HhRDAO4BqUzM4yk0mD/5rEvIv/+FdWuIyOJ9CHo5zNLSDezUmaP2Nwa0aDp/Kjsl0w2OD5RrRyLtzmIMkUO+Pm9Br3TR0FXzFKKFCOljA6QAsUDFVbvXcqooSNtPA0gdo6ACVd+O6/UNwltlEYLBiKJmXWzMmWg7noDHP6J/SjN6nymBsf0lSy6MyYJr66amB+HvUH5heKkEyZfm0DtRctSBoLimlBXxdhXc8Jxnn1+GW2BWR7Wg==
|
|
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
|
|
smtp.mailfrom=retired.ox.ac.uk; dmarc=pass action=none
|
|
header.from=retired.ox.ac.uk; dkim=pass header.d=retired.ox.ac.uk; arc=none
|
|
Received: from CWXP265MB4107.GBRP265.PROD.OUTLOOK.COM (2603:10a6:400:132::8)
|
|
by LO0P265MB6536.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2cf::13) with
|
|
Microsoft SMTP Server (version=TLS1_2,
|
|
cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.14; Sun, 22 May
|
|
2022 14:56:15 +0000
|
|
Received: from CWXP265MB4107.GBRP265.PROD.OUTLOOK.COM
|
|
([fe80::3962:a59:4762:25fc]) by CWXP265MB4107.GBRP265.PROD.OUTLOOK.COM
|
|
([fe80::3962:a59:4762:25fc%3]) with mapi id 15.20.5273.022; Sun, 22 May 2022
|
|
14:56:15 +0000
|
|
From: Lou Burnard <lou.burnard@retired.ox.ac.uk>
|
|
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon-c@plan.io>
|
|
Subject: Re: [SaxonC - Bug #5476] (AwaitingInfo) xsl:result-document doesn't
|
|
function properly
|
|
Thread-Topic: [SaxonC - Bug #5476] (AwaitingInfo) xsl:result-document doesn't
|
|
function properly
|
|
Thread-Index: AQHYbewIPCfzsus7dUCxEzX79l7WWw==
|
|
Date: Sun, 22 May 2022 14:56:15 +0000
|
|
Message-ID: <CWXP265MB41075BEA9B358FB08B59AB2A82D59@CWXP265MB4107.GBRP265.PROD.OUTLOOK.COM>
|
|
Accept-Language: en-US
|
|
Content-Language: en-US
|
|
X-MS-Has-Attach:
|
|
X-MS-TNEF-Correlator:
|
|
suggested_attachment_session_id: 0f25343e-90f8-388a-53b2-39a3ee799569
|
|
authentication-results: dkim=none (message not signed)
|
|
header.d=none;dmarc=none action=none header.from=retired.ox.ac.uk;
|
|
x-ms-publictraffictype: Email
|
|
x-ms-office365-filtering-correlation-id: b081b870-aa5e-4a41-ac57-08da3c03388c
|
|
x-ms-traffictypediagnostic: LO0P265MB6536:EE_
|
|
x-microsoft-antispam-prvs: <LO0P265MB6536B83C80AB4C6AF37986EC82D59@LO0P265MB6536.GBRP265.PROD.OUTLOOK.COM>
|
|
x-ms-exchange-senderadcheck: 1
|
|
x-ms-exchange-antispam-relay: 0
|
|
x-microsoft-antispam: BCL:0;
|
|
x-microsoft-antispam-message-info: Y5nwjvw8dve0pxmlYpdqBlo226iOGuYZIAdob+KAhTOFKlyB7uUVfpxVwhaV64jsvmclYLgOGWDh3pnXgtpm728twagq4TOAy7E2QUQAY8iYpPoT+B8OfJJoRX4kPu9IX8+RxPyUGQ7cGeMM2G/2AcAsfcX2k111Tgw2zY5yKwEOfXRTu2cnmAaTkDW2MwFIFCJLCKAgELO1s3zj+Hmef0ndSl+RqwwuDBnK6QOlEQNYJy4eVsyJKNjramyG713XuQWcib+T8LhQbR529MZtfNaqNs3lZYYUYGUPu5aRqgLHoxh6ZSovFdmiwlEU/iS9uS6jnXbC81IfRE3Bk7qIuI2BFYA8QLqZuUpjB6pZcqYUyQrGvFWuZ54BRqDoP8bBYU+9igDd8BmNkkf76Odqnl8Lt190TGxRPy95VsAtd1BiYAFBzGK4hChgRjv4VDES27XHgy6SAs2W7gzcux4ebRP6UZxDvTCdAZjunJusPudkIcavyOwVzJzAhaEMCfZUE/DG3Syw73KoQyuqAN9QkUnUEkQ17b9f4fWVbCuibvoCTFwzK5unzUy8FwCDi+b3DZCofW6LbzArEC5+rVQhDrZSL07czoNxVumX6sU8LpM9r0NuhwiJeFjw6HIslqckJF0rd1s3RqXH3CaBL09PehIgTBTivNjPQWbEBvvmOBrVNRFxArusiA8E4xHrP5WUe+Tv2vbvTzeso7PwqqAxdqFJK+GA3ZVNXJWLDxryaQCB6uEq0Qq/WOAgYAypL4wSAQDEzISB7yfuqZIBkngaVVlhVt73HH7z2HKF7bbA/GjarLyhoRyzmrWN3YDREJIv
|
|
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CWXP265MB4107.GBRP265.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(13230001)(366004)(53546011)(786003)(6506007)(186003)(316002)(71200400001)(86362001)(55016003)(66556008)(2906002)(91956017)(66476007)(66446008)(8676002)(64756008)(66946007)(33656002)(76116006)(83380400001)(166002)(38100700002)(5660300002)(44832011)(9686003)(38070700005)(19627405001)(8936002)(122000001)(52536014)(7696005)(508600001)(966005)(585924005);DIR:OUT;SFP:1102;
|
|
x-ms-exchange-antispam-messagedata-chunkcount: 1
|
|
x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?Q?sYotLx8v5mqlBl1EyAyQc8qf5eVHQ4yUXDrK8epaQmKFYtffbpwoXwdHgC?=
|
|
=?iso-8859-1?Q?fVD7FYTr1ZjuRD26ronuXwSKkZjqep4pfX1nxtFrDK8p+8d43gIjvyuPEL?=
|
|
=?iso-8859-1?Q?e4ucEQtkHrr4/Uv53VRn9RvkSe5o2Ata+iovf2e9UhpjypcdwUn+/QwKI7?=
|
|
=?iso-8859-1?Q?VezI4D+74BTz3zJpAXVW49fTQGlni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
|
|
Content-Type: multipart/alternative;
|
|
boundary="_000_CWXP265MB41075BEA9B358FB08B59AB2A82D59CWXP265MB4107GBRP_"
|
|
MIME-Version: 1.0
|
|
X-MS-Exchange-CrossTenant-AuthAs: Internal
|
|
X-MS-Exchange-CrossTenant-AuthSource: CWXP265MB4107.GBRP265.PROD.OUTLOOK.COM
|
|
X-MS-Exchange-CrossTenant-Network-Message-Id: b081b870-aa5e-4a41-ac57-08da3c03388c
|
|
X-MS-Exchange-CrossTenant-originalarrivaltime: 22 May 2022 14:56:15.7346
|
|
(UTC)
|
|
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
|
|
X-MS-Exchange-CrossTenant-id: cc95de1b-97f5-4f93-b4ba-fe68b852cf91
|
|
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
|
|
X-MS-Exchange-CrossTenant-userprincipalname: AZVHEVmvoRhZ5JjkkpChXBPJYAI6mYIUPyZqaDom4LMAUcL0xqDF5xB84eQAuRrH
|
|
X-MS-Exchange-Transport-CrossTenantHeadersStamped: LO0P265MB6536
|
|
X-OriginatorOrg: retired.ox.ac.uk
|
|
|
|
--_000_CWXP265MB41075BEA9B358FB08B59AB2A82D59CWXP265MB4107GBRP_
|
|
Content-Type: text/plain; charset="iso-8859-1"
|
|
Content-Transfer-Encoding: quoted-printable
|
|
|
|
I am still very puzzled about how to set the result document URI from withi=
|
|
n an XSLT script using the python wrapper for saxon. So I tried to simplify=
|
|
the issue, and would much appreciate any explanation you can provide...
|
|
|
|
Here is my simple xslt file:
|
|
----
|
|
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
|
|
<xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transform"
|
|
xmlns:xs=3D"http://www.w3.org/2001/XMLSchema"
|
|
exclude-result-prefixes=3D"xs"
|
|
version=3D"2.0">
|
|
<xsl:output media-type=3D"text" omit-xml-declaration=3D"yes" />
|
|
<xsl:template match=3D"/">
|
|
<xsl:variable name=3D"fName">
|
|
<xsl:value-of select=3D"//b/@n"/>
|
|
</xsl:variable>
|
|
<xsl:result-document href=3D"{resolve-uri($fName, static-base-uri()=
|
|
)}">
|
|
<xsl:apply-templates/>
|
|
</xsl:result-document>
|
|
</xsl:template>
|
|
</xsl:stylesheet>
|
|
----
|
|
|
|
Here is my simple test file:
|
|
|
|
----
|
|
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
|
|
<test>
|
|
<a n=3D"wibble">An element</a>
|
|
<b n=3D"ignoreMe">Another element</b>
|
|
</test>
|
|
----
|
|
|
|
Running this in Oxygen or with command line saxon(Saxon-HE 9.4.0.4J) does w=
|
|
hat I expect:
|
|
|
|
----
|
|
lou@Thimk:~/Public/ELTeC-data/Scripts$ saxon test.xml test.xsl
|
|
(base) lou@Thimk:~/Public/ELTeC-data/Scripts$ more ignoreMe
|
|
|
|
An element
|
|
Another element
|
|
----
|
|
|
|
HOWEVER running the following Python test:
|
|
|
|
----
|
|
import sys
|
|
sys.path.append("/usr/lib/Saxon.C.API/python-saxon")
|
|
# import the Saxon/C library
|
|
import saxonc
|
|
with saxonc.PySaxonProcessor(license=3DFalse) as proc:
|
|
print(proc.version)
|
|
xsltproc =3D proc.new_xslt30_processor()
|
|
# Default directory
|
|
baseURI =3D '/home/lou/Public/ELTeC-data/Scripts'
|
|
xsltproc.set_cwd(baseURI)
|
|
# initialise XSLT 3.0 processor result
|
|
# apply stylesheet
|
|
result =3D xsltproc.transform_to_string(source_file=3D'test.xml', st=
|
|
ylesheet_file=3D'test.xsl', base_output_uri=3DbaseURI )
|
|
----
|
|
|
|
produces
|
|
|
|
----
|
|
SaxonC-HE 11.3 from Saxonica
|
|
source in transformFiletoString=3Dtest.xsl stylsheet=3Dtest.xsl
|
|
Error in xsl:result-document/@href on line 12 column 78 of test.xsl:
|
|
XTDE1500 Cannot write to a URI that has already been read:
|
|
file:///home/lou/Public/ELTeC-data/Scripts/test.xsl
|
|
In template rule with match=3D"/" on line 7 of test.xsl
|
|
----
|
|
|
|
I don't care particularly about the typo ("stylsheet"), but why is it
|
|
trying to write to the XSLT source file (I assume that that is the URI
|
|
which has already been read)?
|
|
|
|
|
|
|
|
________________________________
|
|
From: Saxonica Developer Community
|
|
Sent: Monday, May 9, 2022 12:09 PM
|
|
Subject: [SaxonC - Bug #5476] (AwaitingInfo) xsl:result-document doesn't fu=
|
|
nction properly
|
|
|
|
|
|
--- In your reply, please do not write below this line ---
|
|
|
|
Issue #5476<https://saxonica.plan.io/issues/5476?pn=3D1#change-20502> has b=
|
|
een updated by O'Neil Delpratt.
|
|
________________________________
|
|
|
|
* Status changed from New to AwaitingInfo
|
|
|
|
________________________________
|
|
Bug #5476: xsl:result-document doesn't function properly<https://saxonica.p=
|
|
lan.io/issues/5476?pn=3D1#change-20502> open
|
|
|
|
* Author: Lou Burnard
|
|
* Status: AwaitingInfo
|
|
* Priority: Normal
|
|
* Start date: 2022-05-06
|
|
|
|
I upgraded to SaxonC-HE 11.3 and several things stopped working. One I have=
|
|
not yet found a workround for is a stylesheet which calls xsl:result-docum=
|
|
ent, supplying a bare filename as the value for @href. The intention is to =
|
|
create this file in the current directory (obvs) but the context for that t=
|
|
o be done seems to be missing. If the filename supplied does NOT already ex=
|
|
ist I get diagnostics like this:=B6
|
|
Error in xsl:result-document/@href on line 72 column 58 of reporter.xsl: SX=
|
|
RD0002 The system identifier of the principal output file is unknown In tem=
|
|
plate rule with match=3D"/" on line 31 of reporter.xsl None Error in file(f=
|
|
ile, "rt", encoding =3D fileEncoding) : cannot open the connection Calls: r=
|
|
ead.table -> file In addition: Warning message: In file(file, "rt", encodin=
|
|
g =3D fileEncoding) : cannot open file 'metadata.csv': No such file or dire=
|
|
ctory Execution halted
|
|
|
|
but if the file DOES exist (and should therefore be over-written) all I get=
|
|
is
|
|
|
|
Error in xsl:result-document/@href on line 72 column 58 of reporter.xsl: SX=
|
|
RD0002 The system identifier of the principal output file is unknown
|
|
|
|
Either way, this is not what should be happening.
|
|
|
|
________________________________
|
|
|
|
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_CWXP265MB41075BEA9B358FB08B59AB2A82D59CWXP265MB4107GBRP_
|
|
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);" class=3D"elementToProof">
|
|
I am still very puzzled about how to set the result document URI from withi=
|
|
n an XSLT script using the python wrapper for saxon. So I tried to simplify=
|
|
the issue, and would much appreciate any explanation you can provide...
|
|
<div><br>
|
|
</div>
|
|
<div> Here is my simple xslt file:</div>
|
|
<div>----</div>
|
|
<div><?xml version=3D"1.0" encoding=3D"UTF-8"?></=
|
|
div>
|
|
<div><xsl:stylesheet xmlns:xsl=3D"http://www.w3.org/1999/XSL/Transf=
|
|
orm"</div>
|
|
<div> xmlns:xs=3D"http://www.w3.org/2001/XMLSchema"<=
|
|
/div>
|
|
<div> exclude-result-prefixes=3D"xs"</div>
|
|
<div> version=3D"2.0"></div>
|
|
<div> <xsl:output media-type=3D"text" omit-=
|
|
xml-declaration=3D"yes" /></div>
|
|
<div> <xsl:template match=3D"/"></div>
|
|
<div> <xsl:variable name=3D"fName"&=
|
|
gt;</div>
|
|
<div> <xsl:value-of select=3D&q=
|
|
uot;//b/@n"/></div>
|
|
<div> </xsl:variable> =
|
|
</div>
|
|
<div> <xsl:result-document href=3D"{reso=
|
|
lve-uri($fName, static-base-uri())}">
|
|
</div>
|
|
<div> <xsl:apply-templates/>=
|
|
</div>
|
|
<div> </xsl:result-document></div>
|
|
<div> </xsl:template></div>
|
|
<div></xsl:stylesheet></div>
|
|
<div>----</div>
|
|
<div><br>
|
|
</div>
|
|
<div>Here is my simple test file:</div>
|
|
<div><br>
|
|
</div>
|
|
<div>----</div>
|
|
<div><?xml version=3D"1.0" encoding=3D"UTF-8"?></=
|
|
div>
|
|
<div><test></div>
|
|
<div> <a n=3D"wibble">An element</a></di=
|
|
v>
|
|
<div> <b n=3D"ignoreMe">Another element</b&=
|
|
gt;</div>
|
|
<div></test></div>
|
|
<div>----</div>
|
|
<div><br>
|
|
</div>
|
|
<div>Running this in Oxygen or with command line saxon(Saxon-HE 9.4.0.4J) d=
|
|
oes what I expect:</div>
|
|
<div><br>
|
|
</div>
|
|
<div>----</div>
|
|
<div>lou@Thimk:~/Public/ELTeC-data/Scripts$ saxon test.xml test.xsl</div>
|
|
<div>(base) lou@Thimk:~/Public/ELTeC-data/Scripts$ more ignoreMe </div>
|
|
<div><br>
|
|
</div>
|
|
<div> An element</div>
|
|
<div> Another element</div>
|
|
<div>----</div>
|
|
<div><br>
|
|
</div>
|
|
<div>HOWEVER running the following Python test:</div>
|
|
<div><br>
|
|
</div>
|
|
<div>----</div>
|
|
<div>import sys</div>
|
|
<div>sys.path.append("/usr/lib/Saxon.C.API/python-saxon")</div>
|
|
<div># import the Saxon/C library</div>
|
|
<div>import saxonc</div>
|
|
<div>with saxonc.PySaxonProcessor(license=3DFalse) as proc:</div>
|
|
<div> print(proc.version)</div>
|
|
<div> xsltproc =3D proc.new_xslt30_processor()</d=
|
|
iv>
|
|
<div> # Default directory</div>
|
|
<div> baseURI =3D '/home/lou/Public/ELTeC-data/Sc=
|
|
ripts'</div>
|
|
<div> xsltproc.set_cwd(baseURI)</div>
|
|
<div> # initialise XSLT 3.0 processor result</div>
|
|
<div> # apply stylesheet </div>
|
|
<div> result =3D xsltproc.transform_to_string(sou=
|
|
rce_file=3D'test.xml', stylesheet_file=3D'test.xsl', base_output_uri=3Dbase=
|
|
URI )</div>
|
|
<div>----</div>
|
|
<div><br>
|
|
</div>
|
|
<div>produces </div>
|
|
<div><br>
|
|
</div>
|
|
<div>----</div>
|
|
<div>SaxonC-HE 11.3 from Saxonica</div>
|
|
<div>source in transformFiletoString=3Dtest.xsl stylsheet=3Dtest.xsl</div>
|
|
<div>Error in xsl:result-document/@href on line 12 column 78 of test.xsl:</=
|
|
div>
|
|
<div> XTDE1500 Cannot write to a URI that has already been read=
|
|
:</div>
|
|
<div> file:///home/lou/Public/ELTeC-data/Scripts/test.xsl</div>
|
|
<div> In template rule with match=3D"/" on line 7 of test.x=
|
|
sl</div>
|
|
<div>----</div>
|
|
<div><br>
|
|
</div>
|
|
<div>I don't care particularly about the typo ("stylsheet"), but =
|
|
why is it</div>
|
|
<div>trying to write to the XSLT source file (I assume that that is the URI=
|
|
</div>
|
|
<div>which has already been read)?</div>
|
|
<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> Monday, May 9, 2022 12:09 PM<br>
|
|
<b>Subject:</b> [SaxonC - Bug #5476] (AwaitingInfo) xsl:result-document doe=
|
|
sn't function properly
|
|
<div><br>
|
|
</div>
|
|
</div>
|
|
<div class=3D"rps_ae3a">
|
|
<div style=3D"font-family:"ProximaNova-Regular",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/5476?pn=3D1#change-20502" =
|
|
target=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" s=
|
|
tyle=3D"color:#0088b7">
|
|
#5476</a> has been updated by O'Neil Delpratt.
|
|
<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">
|
|
<li><strong>Status</strong> changed from <i>New</i> to <i>AwaitingInfo</i><=
|
|
/li></ul>
|
|
<hr style=3D"width:100%; height:1px; background:#ccc; border:0; margin:1.2e=
|
|
m 0">
|
|
<h1 style=3D"font-family:"ProximaNova-Bold",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/5476?pn=3D1#change-20502" target=
|
|
=3D"_blank" rel=3D"noopener noreferrer" data-auth=3D"NotApplicable" style=
|
|
=3D"color:#0088b7; text-decoration:none">Bug #5476: xsl:result-document doe=
|
|
sn't function properly</a>
|
|
<span class=3D"x_badge x_badge-status-open" style=3D"font-weight:bold; font=
|
|
-size:10px; bottom:2px; padding:1px 3px; margin-right:2px; margin-left:2px;=
|
|
border-radius:2px; text-transform:uppercase; text-decoration:none; color:#=
|
|
205D86; border:1px solid #205D86">
|
|
open</span> </h1>
|
|
<ul class=3D"x_details" style=3D"color:#959595; margin-bottom:1.5em">
|
|
<li><strong>Author: </strong>Lou Burnard</li><li><strong>Status: </strong>A=
|
|
waitingInfo</li><li><strong>Priority: </strong>Normal</li><li><strong>Start=
|
|
date: </strong>2022-05-06</li></ul>
|
|
<a name=3D"x_I-upgraded-to-SaxonC-HE-113-and-several-things-stopped-working=
|
|
-One-I-have-not-yet-found-a-workround-for-is-a-stylesheet-which-calls-xslre=
|
|
sult-document-supplying-a-bare-filename-as-the-value-for-href-The-intention=
|
|
-is-to-create-this-file-in-the-current-directory-obvs-but-the-context-for-t=
|
|
hat-to-be-done-seems-to-be-missing-If-the-filename-supplied-does-NOT-alread=
|
|
y-exist-I-get-diagnostics-like-this" style=3D"color:#0088b7"></a>
|
|
<h2 style=3D"font-family:"ProximaNova-Bold",Helvetica,Arial,sans-=
|
|
serif; font-weight:normal; margin:0px; font-size:1.1em; font-size:2em; line=
|
|
-height:1em">
|
|
I upgraded to SaxonC-HE 11.3 and several things stopped working. One I have=
|
|
not yet found a workround for is a stylesheet which calls xsl:result-docum=
|
|
ent, supplying a bare filename as the value for @href. The intention is to =
|
|
create this file in the current
|
|
directory (obvs) but the context for that to be done seems to be missing. =
|
|
If the filename supplied does NOT already exist I get diagnostics like this=
|
|
:<a href=3D"#x_I-upgraded-to-SaxonC-HE-113-and-several-things-stopped-worki=
|
|
ng-One-I-have-not-yet-found-a-workround-for-is-a-stylesheet-which-calls-xsl=
|
|
result-document-supplying-a-bare-filename-as-the-value-for-href-The-intenti=
|
|
on-is-to-create-this-file-in-the-current-directory-obvs-but-the-context-for=
|
|
-that-to-be-done-seems-to-be-missing-If-the-filename-supplied-does-NOT-alre=
|
|
ady-exist-I-get-diagnostics-like-this" class=3D"x_wiki-anchor" style=3D"col=
|
|
or:#0088b7; display:none">=B6</a></h2>
|
|
<h2 style=3D"font-family:"ProximaNova-Bold",Helvetica,Arial,sans-=
|
|
serif; font-weight:normal; margin:0px; font-size:1.1em; font-size:2em; line=
|
|
-height:1em">
|
|
Error in xsl:result-document/@href on line 72 column 58 of reporter.xsl: SX=
|
|
RD0002 The system identifier of the principal output file is unknown In tem=
|
|
plate rule with match=3D"/" on line 31 of reporter.xsl None Error=
|
|
in file(file, "rt", encoding =3D fileEncoding)
|
|
: cannot open the connection Calls: read.table -> file In addition: War=
|
|
ning message: In file(file, "rt", encoding =3D fileEncoding) : ca=
|
|
nnot open file 'metadata.csv': No such file or directory Execution halted</=
|
|
h2>
|
|
<p>but if the file DOES exist (and should therefore be over-written) all I =
|
|
get is</p>
|
|
<p>Error in xsl:result-document/@href on line 72 column 58 of reporter.xsl:=
|
|
SXRD0002 The system identifier of the principal output file is unknown</p>
|
|
<p>Either way, this is not what should be happening.</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/5476?pn=3D1#=
|
|
change-20502">
|
|
<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_CWXP265MB41075BEA9B358FB08B59AB2A82D59CWXP265MB4107GBRP_--
|