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

RE: For-each iteration problem

Subject: RE: For-each iteration problem
From: "Ricaud Matthieu" <matthieu.ricaud@xxxxxxx>
Date: Fri, 19 Mar 2004 10:07:17 +0100
multiple xsl for each
Hi !

Instead of <input type="{$multiple}" name="{$label}" value="node()"> write :
<input type="{$multiple}" name="{$label}" value="{node()}"> or even shorter
:
<input type="{$multiple}" name="{$label}" value="{.}">
(everywhere node() can be replace by ".")

But I don't really see what you feel like to do... What are the parameters
multiple, label, do you give them a value anywhere ? What is the meaning of
the test to had a <br/> ? How do you match the other xml elements ?

Cheers,

Matthieu.

-----Message d'origine-----
De : owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]De la part de Johnson,
Kaerstin
Envoyé : jeudi 18 mars 2004 22:12
À : xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Objet :  For-each iteration problem



I have a piece of xml that will be printed out as html checkboxes or radio
boxes depending on the value of the multiple variable (which will be radio
or checkbox)... I was unable to get this to work easily, and the code I am
using now seems to put an extra/blank input box before each value...

Below is the code Im using starting from match possibleValues and the xml
snippet it 'should' translate...

<xsl:template match="possibleValues" >
     <xsl:param name="multiple"/>
     <xsl:param name="label"/>

               <xsl:for-each select="node()" >
                <input type="{$multiple}" name="{$label}" value="node()">
                <xsl:value-of select="node()" />    &#160; &#160;
                </input>
                <xsl:if test="position() mod 4 = 0"> <br /> </xsl:if>

               </xsl:for-each>



</xsl:template>

sample xml:
<dataElement>
		<name>Field Name</name>
		<description>Field Description</description>
		<visible>visible</visible>
		<display>choicebox</display>
		<optional>optional</optional>
		<multipleAllowed>true</multipleAllowed>
		<possibleValues>
			<values>image</values>
			<values>webpage</values>
			<values>text</values>
			<values>number</values>
			<values>money</values>
			<values>animal</values>
			<values>mojo</values>
</possibleValues>
	</dataElement>

Any help is greatly appreciated...



 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

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.