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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Write XML element into textbox with XSLT 3

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
Hi, I'm using XSLT to format an XML document but I want to write some of the XML into HTML form controls. For example, I'd like a textbox to contain the data from one of the XML elements. It won't let me do this...

Code:
<input type="text" id="whatever" value="<xsl:value-of select="RESPONSE"/>" />

...so is there a correct way to achieve this?

Thanks.

Tom
emo_big_smile.gif
 
>[tt]<input type="text" id="whatever" value="<xsl:value-of select="RESPONSE"/>" />[/tt]

It is about this if RESPONSE is the correct match.
[tt]
<input>
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="id">whatever</xsl:attribute>
<xsl:attribute name="value"><xsl:value-of select="RESPONSE" /></xsl:attribute>
</input>
[/tt]
 
Perfect! Thank you so much. I hereby award you a star!

Tom
emo_big_smile.gif
 
More concise is:
Code:
<input type="text" id="whatever" value="{RESPONSE}"/>

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top