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

Re: Newbie Question with @value

Subject: Re: Newbie Question with @value
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Tue, 28 Mar 2006 14:11:03 -0600
Re:  Newbie Question with @value
>                                                 <xsl:if
test="@type='radio'">
>                                                         <asp:RadioButtonList
id="{@name}" runat="server">
>
<xsl:for-each select="choice">
>
<asp:ListItem Value="{@value}">
             ^^^ where is the attribute value in your input xml on the
choice element?

>                 <choice>High School</choice>
>                 <choice>Some College</choice>
>                 <choice>College</choice>
                              ^^^ no attributes


> my question is why isn't the Value or Text of the ListItem being filled in?
I can't seem to put 2 and 2 together here.  Any links to help debug this would
be greatly apprecated.  Thanks all.

What do you expect it to fill in?  There's no attribute called value
anywhere in your XML as far as I can tell.

You're going over each node that is a question (//question) and doing
some output based on the values of the type attribute (the various
<xsl:if test="@type='blah'>. For the radio buttons you're applying a
chunk of code to each choice element.  You're trying to grab the value
attribute (@value) two times in that code block.

I'm guessing what you want is the text value of the current node.
(text value is perhaps a poor choice of words, but the value of
applying string to the various nodes as outlined in the Xpath and XSLT
specs). If you just want the value of the current node (ie choice) do
<asp:ListItem Value="{.}">
    <xsl:value-of select="."/>

...


see http://www.w3.org/TR/xslt#value-of

Jon Gorman

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.