Re: [xsl] unable to resolve intersect/union operator

Subject: Re: [xsl] unable to resolve intersect/union operator
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 19 May 2005 17:17:16 +0100
> 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