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

Re: set union? xslt 2.0

Subject: Re: set union? xslt 2.0
From: Dave Pawson <davep@xxxxxxxxxxxxx>
Date: Thu, 8 Apr 2010 10:42:20 +0100
Re:  set union? xslt 2.0
On Thu, 08 Apr 2010 10:25:48 +0100
David Carlisle <davidc@xxxxxxxxx> wrote:


> 
> <xsl;template 
> select="skillarea[tokenize(@targets,'|')=tokenize($param,'|')]"/>
> 
> if you're worried about repeatedly tokenizing the attributes probably 
> you can optimise this with a key or some such, or perhaps saxon will 
> optimise for you behind the scenes or perhaps it's fast enough anyway.

No problem with speed.
   <grin/> Guess you mean
<xsl:template 
  match="skillarea[tokenize(@targets,'|')=tokenize($param,'|')]"/>

This is the 'odd' meaning of = in xslt 2?
If any item on LHS is present in RHS then = returns true.

Issue:
  What happens with tokenize when the separator is missing?
empty set? 
  Resolve using if contains(@target,'|') then tokenize.... else ...
Getting rather messy since either could be a list.

I think this idea would work without a separator? 
param = "term1 term 2" 
@target="term1 oddone"

Would the equality work then? Currently strings, is this a case
where a sequence is needed?


-- 

regards 

-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

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.