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

Re: XSLT 3.1 that keeps both Saxon EE and HE happy and

Subject: Re: XSLT 3.1 that keeps both Saxon EE and HE happy and tokenizes an attribute
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Sep 2024 04:32:05 -0000
Re:  XSLT 3.1 that keeps both Saxon EE and HE happy and
On Thu, Sep 26, 2024 at 04:21:07AM -0000, Robert Stuart
bobstuart@xxxxxxx scripsit:
> I have quite a few attributes whose values are space delimited tokens.
> Saxon EE C"BBknowsC"BB they are lists of tokens since the schema does have
> them a lists so they can be constrained and validated at the XSD
> level. tokenize(./@someAttribute) works great in HE but bombs in EE
> with A sequence of more than one item is not allowed as the first
> argument of fn:tokenize() 
> 
> This feels like it should be obvious and trivial but has been
> irritating me for a while now. 
[snip]

HE will never know the type is a sequence type, and EE always will.

I'd go with two templates and the use-when attribute with a value of
something like 

contains(system-property('xsl:product-version'),'EE')

(with 'HE' for the HE one) though I'd want to check what the actual
returned values are.

The HE template uses tokenize() and the EE one doesn't, since it's
already going to have a sequence of strings.

Making this work with Schematron probably requires using a variable and
setting the variable value based on an if statement that checks
system-property().

-- Graydon

-- 
Graydon Saunders  | graydonish@xxxxxxxxxxxx
CBCB&s oferCB)ode, CB0isses swCB! mCB&g.
-- Deor  ("That passed, so may this.")

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.