[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Saxon command-line: How to assign a sequence of m

Subject: Re: Saxon command-line: How to assign a sequence of multiple strings to a global param
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 5 Nov 2018 17:56:32 -0000
Re:  Saxon command-line: How to assign a sequence of  m
In recent releases you can do

"?MY_ARRAY=('one', 'two', 'three')"

but note that the exact rules for use of double-quotes around a string
containing special characters depend on which command line processor (shell)
you use.

I don't know if this syntax was available in 9.2, you will have to check. The
question-mark signals that what follows the parameter name is an XPath
expression rather than a simple string literal.

Note that the normal syntax name=value interprets value as xs:untypedAtomic,
which is therefore cast to the required/declared type of the xsl:param. This
will work for parameters declared as integer, boolean or string, but not for a
sequence.

Michael Kay
Saxonica

> On 5 Nov 2018, at 17:38, Jorge . chocolate.camera@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> Running Saxon from the command line (testing with Saxon-HE 9.2.1.2Jbyes,
old as heckbon Bash 3.2.57(1)), is there a way to set the value of a global
parameter of an XSLT2 stylesheet to a sequence of strings?
>
>     <xsl:param name="MY_ARRAY" as="xs:string*"/>
>
> When attempting to do it like this:
>
>     java  -jar saxon9he.jar [options] 'MY_ARRAY="one" "two" "three"'
>     java  -jar saxon9he.jar [options] MY_ARRAY='"one" "two" "three"'
>
> Saxon seemingly interprets spaces as literal, and the value of the parameter
becomes one single string
>
>     <xsl:message select="count($MY_ARRAY)"/>
> b 1
>
> instead of interpreting them as separators so that the value of the
parameter contains those three.
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/293509> (by
email <>)

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.