Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML and HTML FORMS

Status
Not open for further replies.

markSaunders

Programmer
Jun 23, 2000
196
GB
how on earth do i for a text box and populate the value from an XML doc using XSL. i have tried with the following XSL...

Code:
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl=&quot;[URL unfurl="true"]http://www.w3.org/TR/WD-xsl&quot;>[/URL] 
<xsl:template> 
<xsl:element name=&quot;STOCKFILE&quot;/> 
<xsl:for-each select=&quot;STOCKFILE&quot;> <html> <head> 
<title>StockDetail01(XSL 02)</title></head>
<body>
.
.
.
Code:
<xsl:for-each select=&quot;STOCK&quot;>
  <xsl:element name=&quot;input&quot;>
    <xsl:attribute name=&quot;type&quot;>
      text
    </xsl:attribute>
      <xsl:attribute name=&quot;value&quot;>
        <xsl:value-of select=&quot;ST01-DESCR&quot;/>
      </xsl:attribute>
  </xsl:element>
</xsl:for-each>

i get the text box to appear, but no content :-(

any help appreciated.
m Mark Saunders :)
 
FYI sussed it!

Code:
    <xsl:attribute name=&quot;type&quot;>
      text
    </xsl:attribute>

should read...
Code:
    <xsl:attribute name=&quot;type:text&quot;>
    </xsl:attribute>

but any examples showing XML data being placed into a HTML form and (presumably) allowing the [tt]Submit[/tt] button to send the contexts back off somewhere would be most greatfully appreciated.
cheers Mark Saunders :)
 
<xsl:for-each select=&quot;STOCK&quot;>
<FORM METHOD=&quot;POST&quot; ACTION=&quot;cgi-bin\myApp.exe&quot;>
<TD>
<INPUT TYPE=&quot;SUBMIT&quot;/>
</TD>
<INPUT TYPE=&quot;HIDDEN&quot; NAME=&quot;input&quot;>
<xsl:attribute name=&quot;VALUE&quot;>
<xsl:value-of select=&quot;ST01-DESCR&quot;/>
</xsl:attribute>
</INPUT>
</FORM>
</xsl:for-each>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top