This is the mail archive of the xsl-list@mulberrytech.com mailing list .
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
> Hi, > > I want to take XML and generate an input form using XSLT. In straight > HTML, I would code this: > > <INPUT TYPE = "TEXT" NAME="FIRSTNAME" VALUE="JAMES" > I believe the proper way would be like this: <INPUT TYPE="TEXT" VALUE="JAMES"> <xsl:attribute name="NAME"> <xsl:value-of select="$foo"/> </xsl:attribute> </INPUT> Where "$foo" could be XPath or a variable. I've run into having to create a unique NAME for several values and did this: <xsl:for-each select="/foo/bar"> <xsl:variable name="uniqueID"> <xsl:text>FIRSTNAME_</xsl:text> <xsl:value-of select="position()"/> </xsl:variable> <INPUT TYPE="TEXT"> <xsl:attribute name="NAME"> <xsl:value-of select="$uniqueID"/> </xsl:attribute> </INPUT> </xsl:for-each> This will run through all the /foo/bar's and give them FIRSTNAME_1, FIRSTNAME_2, FIRSTNAME_3, etc. Not sure if that's what you wanted to do exactly... Dan Cederholm -- http://www.cederholm.tv dan@cederholm.tv XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |