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

Re: unable to resolve intersect/union operator

Subject: Re: unable to resolve intersect/union operator
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 19 May 2005 17:17:16 +0100
xsl operator contains
> Sorry but its still not working out and Im getting quite sick of it !

But the code you just posted isn't anything like the stylesheet that I
posted (which did produce the result that you said you wanted)

            <xsl:variable name="aVal" 
select="normalize-space($interim/A/Value)"/>

If there is more than one Value element that is an error. (As I stated
at the beginning)
If there is one Value element then it returns the string
with the whitespace normalized value.

as $aVal contains a single string (if its not an error
and $bVal is the same

$aVal[for $a in . return $bVal[contains(.,$a)]]
is the same  as 
if (contains($bVal,$aVal)) then $aVal else ()

except that your test file has more than one Value so you will error.

get rid of

        <xsl:variable name="aVal" 
select="normalize-space($interim/A/Value)"/>

and replace it by
     


        <xsl:variable name="aVal" 
select="$interim/A/Value/normalize-space()"/>


or if you haven't updated saxon yet then 



        <xsl:variable name="aVal" 
select="for $x in $interim/A/Value return normalize-space($x)"/>

Really you should update saxon asap, writing stylesheets that work with
ancient versions of XPath2 is just leading to maintenance problems in
the future (and makes it hard for anyone to offer help as they have to
remember what the syntax was in earlier drafts) XSLT2 doesn't change
much from draft to draft, but XPath has been more volatile.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.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.