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

Re: element values don't display with value-of

Subject: Re: element values don't display with value-of
From: "Vasu Chakkera" <vasucv@xxxxxxxxxxx>
Date: Fri, 1 Nov 2002 17:10:37 -0000
jsp value apostrophe
Graham ,
 <xsl:for-each select="sources/source">
> <xsl:value-of select="source" />  (value here)

your for-each iterates through each of the source nodes. and when you say
<xsl:value-of select="source" /> it would mean you are trying to select the
value of "source" element which is the child of the context node ( which is
source). and since you dont have any <source> element under sources/source,
you are not getting any value.
What you need  to select is the value of current node,
try instead,
 <xsl:for-each select="sources/source">
 <xsl:value-of select="." />
----- Original Message -----
From: <penfool@xxxxxxxxx>
To: <XSL-List@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, November 01, 2002 4:52 PM
Subject:  element values don't display with value-of

> I'm having a problem getting element values to display.
> Here is the XML structure:
> articles
> article
> name /name
> description /description
> bodyblock
> summary /summary
> analysis /analysis
> sources
>      source /source
>      source /source
>      source /source
> /sources
> /bodyblock
> /article
> /articles
> When a bodyblock node is the current context, I call the
> following template to show the sources:
> <xsl:template name="list-sources">
> <xsl:for-each select="sources/source">
> <xsl:value-of select="source" />  (value here)
> <br/>
> </xsl:for-each>
> </xsl:template
> Since I get the correct number of "(value here)" lines
> for each bodyblock in the results, the source elements
> are obviously being parsed, but none of the source
> values show up. Am I missing something obvious here? I
> am doing the same thing for other nodes (article,
> bodyblock)and those work fine.
> I'm using Forte/JSP for development with SAX as the
> parser.
> Thanks,
> Graham Tillotson
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


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.
First Name
Last Name
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.