tags:

views:

17

answers:

1

I'm trying to get xsl to drop a value into a text box via the html ... something like

Name : <input id="Name" type="text" value=<xsl:value-of select="something"/> />

but that doesn't work (didn't expect it to) -- is there a way to make this work?

+2  A: 

There are two ways to do this. The normal way:

<input id="Name" type="text">
  <xsl:attribute name="value">
    <xsl:value-of select="something"/>
  </xsl:attribute>
</input>

And the shortcut:

<input id="Name" type="text" value="{something}"/>
Welbog
any thoughts on which is "better"?
jeriley
One is obviously shorter, but at the same time it's easier to overlook. I would tend to use the short version, though, as long as the expression inside is small and clear. I'd use the short version with an `xsl:variable` for more complex expressions.
Welbog