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

Re: multiple node values not being returned

Subject: Re: multiple node values not being returned
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 20 May 2005 13:11:51 +0100
xpath multiple parameters
  <xsl:for-each select="$interim/A/Value">
             <xsl:variable name="aVal" select="."/>
            <xsl:value-of select="distinct-values($aVal[for $a in . 
  return $oVal[contains(.,$a)]])"/>
               <xsl:if test="position() != last()"><xsl:value-of select="' 
  '"/></xsl:if>
  </xsl:for-each>   


there you are just generating text so you could have done it with a
single value-of and xpath (as I showed originally).
Do you want to generate text (as here) or element nodes (as in your
original message in this thread) the techniques required are rather
different in the two cases.

You have copied my 
$aVal[for $a in .
code but here (as I said the other day) as  it is not doing anything
useful as $aVal is a single node in this case not the set of all A nodes
as in the first solution I posted. Similarly distinct-values() isn't
doing anything at all as there is (at most) one value on the sequence:
you are starting with . and then filtering that with a predicate.

             <xsl:variable name="aVal" select="."/>
            <xsl:value-of select="distinct-values($aVal[for $a in . 
  return $oVal[contains(.,$a)]])"/>

is just testing if the string value of the current node is contained in
an oVal node, so it is just something like:

            <xsl:value-of select="if ($oVal[contains(.,current())])
              then . else ()"/>

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.