Project

Profile

Help

Bug #3635 ยป Bug #10998 - 2018-01-21T23_26_56Z.eml

Liam Quin, 2018-01-22 00:26

 
Return-Path: <liam@w3.org>
Received: from m.launchco.com ([127.0.0.1]) by m.launchco.com (Dovecot) with LMTP id PSWSDWQhZVpXRAAAa1G0NA for <dropbox@plan.io>; Mon, 22 Jan 2018 00:26:50 +0100
Received: from raoul.w3.org (raoul.w3.org [128.30.52.128]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by m.launchco.com (Postfix) with ESMTPS id 5CA7626BEB for <inbox+saxonica+f38e+saxon@plan.io>; Mon, 22 Jan 2018 00:26:49 +0100
Received: from xplr-96-44-106-9.xplornet.com ([96.44.106.9] helo=slave.barefootcomputing.com) by raoul.w3.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <liam@w3.org>) id 1edP0g-0004bR-P0 for inbox+saxonica+f38e+saxon@plan.io; Sun, 21 Jan 2018 23:26:47 +0000
Date: Sun, 21 Jan 2018 18:26:44 -0500
From: "Liam R. E. Quin" <liam@w3.org>
To: Saxonica Developer Community <inbox+saxonica+f38e+saxon@plan.io>
Message-ID: <1516577204.4506.241.camel@w3.org>
In-Reply-To: <redmine.journal-10992.20180121143939.bd4c2ce665b9e662@plan.io>
References: <redmine.issue-3635.20180121012703@plan.io>
<redmine.journal-10992.20180121143939.bd4c2ce665b9e662@plan.io>
Subject: Re: [Saxon - Bug #3635] passing stylesheet parameters via
fn:transform causes an exception
Mime-Version: 1.0
Content-Type: text/plain;
charset=UTF-8
Content-Transfer-Encoding: 7bit
X-He-Spam-Score: -4.2
Delivered-To: <dropbox@plan.io>
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on m.launchco.com
X-Spam-Level:
X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.0
X-Spam-Report: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at
http://www.dnswl.org/, * medium trust * [128.30.52.128 listed in
list.dnswl.org] * -0.0 SPF_HELO_PASS SPF: HELO matches SPF record * -1.9
BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000]
X-Spam-Score: -4.2
Envelope-to: inbox+saxonica+f38e+saxon@plan.io
Authentication-Results: m.launchco.com; dmarc=none header.from=w3.org
Organization: The World Wide Web Consortium (W3C)
X-Mailer: Evolution 3.26.3 (3.26.3-1.mga7)


You are right on all three counts, sorry for the noise!

The F&O spec does say Type: map(xs:QName, item()*) for stylesheet-
params.

On the other hand, it'd be helpful not to have Saxon crash...


On Sun, 2018-01-21 at 15:39 +0100, Saxonica Developer Community wrote:
> --- In your reply, please do not write below this line ---
>
> Issue #3635 has been updated by Martin Honnen.
>
>
> I think you have three problems in your use of @transform@, the first
> is that you need to use a @QName@ (and not a string) for the
> parameter name, the second is that the @transform@ function returns a
> map where you find the primary result as the map item named @output@
> and the third is that you use @xsl:copy@ (which only makes a shallow
> copy) instead of @xsl:copy-of@ (which creates a deep copy) when you
> try to output the result of the function. So what you want is
>
> <pre><code class="xml">
> <xsl:stylesheet version="3.0" xmlns:xsl="http://www.w3.org/1999/XSL/T
> ransform"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">;
>
> <xsl:template match="/">
> <xsl:copy-of
> select="
> transform(
> map {
> 'stylesheet-location':
> 'test201801210102.xsl',
> 'source-node': /,
> 'stylesheet-params': map {
> QName('', 'garment'):
> 'hoodie',
> QName('', 'colour'):
> 'black'
> }
> }
> )?output"
> />
> </xsl:template>
>
> </xsl:stylesheet>
> </code></pre>
>
> I think.
>
>
> ----------------------------------------
> Bug #3635: passing stylesheet parameters via fn:transform causes an
> exception
> https://saxonica.plan.io/issues/3635?pn=1#change-10992
>
> * Author: Liam Quin
> * Status: New
> * Priority: Normal
> * Assignee:
> * Category:
> * Sprint/Milestone:
> * Legacy ID:
> * Applies to branch: 9.8
> * Fix Committed on Branch:
> * Fixed in Maintenance Release:
> ----------------------------------------
> If i run the enclosed stylesheet, i get an error; this is a stripped-
> down example. I get what looks like the same error if i try to pass
> an option map to fn:serialize. In both cases i can work round it by
> passing an XML fragment.
>
> I also get the same (or a similr, didn't check) error with Saxon EE
> run from Oxygen XML Editor version 19 (didn't try earlier versions).
>
> java -jar /home/lee/packages/saxonpe/saxon9pe.jar
> exception.xsl exception.xsl
> java.lang.RuntimeException: Internal error evaluating template
> rule at line 7 in module file:/home/lee/mulberry/balisage-
> proceedings/deliver/exception.xsl
> at
> net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule
> .java:360)
> at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:502)
> at
> net.sf.saxon.Controller.transformDocument(Controller.java:2402)
> at net.sf.saxon.Controller.transform(Controller.java:1970)
> at
> net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer
> .java:593)
> at net.sf.saxon.Transform.processFile(Transform.java:1257)
> at net.sf.saxon.Transform.doTransform(Transform.java:780)
> at net.sf.saxon.Transform.main(Transform.java:81)
> Caused by: java.lang.ClassCastException:
> net.sf.saxon.value.StringValue cannot be cast to
> net.sf.saxon.value.QNameValue
> at
> net.sf.saxon.functions.TransformFn.call(TransformFn.java:639)
> at
> net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:547)
> at
> net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:43
> 4)
> at
> net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule
> .java:347)
> ... 7 more
> Fatal error during transformation: java.lang.RuntimeException:
> Internal error evaluating template rule at line 7 in module
> file:/home/lee/mulberry/balisage-proceedings/deliver/exception.xsl
>
>
> ---Files--------------------------------
> exception-two.xsl (351 Bytes)
> exception.xsl (467 Bytes)
>
>
> --
> You have received this notification because you have either
> subscribed to or are involved in a project on Saxonica Developer
> Community site.
> To change your notification preferences, please click here: https://s
> axonica.plan.io/my/account?tour=mail_preferences
>
> This notification was cheerfully delivered by https://plan.io
>
--
Liam Quin, W3C, http://www.w3.org/People/Quin/
Staff contact for Verifiable Claims WG, SVG WG, XQuery WG

Web slave for http://www.fromoldbooks.org/
    (1-1/1)