|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Creating an input form, XML -> XSLT -> HTML
> 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@xxxxxxxxxxxx XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! 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
|

Cart








