|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Cast Your Vote
We need your help – Vote for DataDirect XML Products!
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! Subscribe in XML format
|







