[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: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Fri, 20 May 2005 14:37:04 +0100
RE:  multiple node values not being returned
> In trying to solve a problem I have encountered another problem where 
> all the A/Value text are not being returned. Instead only the first 
> A/Value term is being returned.

My guess is that your stylesheet specifies version="1.0", which means that
xsl:value-of will do the "1.0 thing" and output only the first item in the
selected sequence.

Michael Kay
http://www.saxonica.com/


> 
> Heres my code.
> 
> <xsl:variable name="map" select="document('input.xml')"/>
> <xsl:variable name="interim" 
> select="$map/TopConcept/*[name()=$aTerm]"/> 
> <!-- where $aTerm='Parts' -->
>           <xsl:message>Interim = <xsl:value-of 
> select="$interim"/></xsl:message>  <!-- Interim = Parts 
> Handle Bolt Nut 
> No ClassName -->                                              
>           
>            <xsl:variable name="aVal" select="for $x in 
> $interim/A/Value 
> return normalize-space($x)"/>
>     
>           <xsl:message>A Val= <xsl:value-of select="$aVal"/> 
> </xsl:message> <!-- A Val = Handle -->
> </xsl:variable>
> 
> I expect 'A Val' to return 'Hande Bolt Nut' but it only 
> returns 'Handle'.
> 
> What could the problem be considering $interim contains all 
> the values 
> correctly ? My input.xml file is attached below:
> 
> --------------
> input.xml
> --------------
> <Parts>
>    <A>
>     <Class id="123" type="none">Parts</Class>
>     <Value id="345" type="text">Handle</Value>
>     <Value id="456" type="text">Bolt</Value>
>     <Value id="567" type="text">Nut</Value>
>    </A>
>     <B>
>     <Class id="none" type="Property">No ClassName</Class>
>     </B>
> </Parts>
> 
> Appreciate any help.
> 
> Thanks
> Rahil

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.