[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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 14:13:31 +0100

> $interim/A/normalize-space() gives an error. However normalize-space($interim/A) 

That's the price you pay for working with a draft specification.

The rules changed, and saxon changed with it, you need saxon 8.4 for the first
form to work. The second form will generate an error if there is more
than one $interim/A node.

Looks like you want to know all the A Values that are contained in any B


on your input file

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="2.0">


<xsl:template match="Parts">
<xsl:value-of select="distinct-values(
 A/Value[for $a in . return /Parts/B/Value[contains(.,$a)]]
  )"
 separator=", "/>
</xsl:template>

</xsl:stylesheet>


$ saxon8 parts.xml parts.xsl
<?xml version="1.0" encoding="UTF-8"?>Handle, Bolt

You don't need distinct-values() on your test case, it's only needed if A
may have repeated values.

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