Subject: RE: How to embed xsl:value-of into html tag From: "Evan Lenz" <elenz@xxxxxxxxxxx> Date: Thu, 24 Aug 2000 16:46:46 -0700 |
Use an attribute value template (AVT) as follows: <input type="text" name="productName" value="{.}" size="25" maxlength="30"/> Putting curly braces around an XPath expression in the context of a literal result element's attribute value (and a few select XSLT instructions' attribute values) is exactly the same as doing the following (which would be another solution to your problem): <input type="text" name="productName" size="25" maxlength="30"> <xsl:attribute name="value"> <xsl:value-of select="."/> </xsl:attribute> </input> I think you will agree that, since you don't need anything like conditional processing to get the desired value of your attribute, the former solution is a much nicer one. Hope this helps. Evan Lenz elenz@xxxxxxxxxxx http://www.xyzfind.com XYZFind Corp. "Building Better Search" -----Original Message----- From: owner-xsl-list@xxxxxxxxxxxxxxxx [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Joan Shu Sent: Thursday, August 24, 2000 3:22 PM To: 'XSL-List@xxxxxxxxxxxxxxxx' Subject: How to embed xsl:value-of into html tag Hi, I can't get this working. value of the input field will be <xsl:value-of select="."> instead of the real name -- XML Bible. I guess XSLT will not transform any XSL statement inside a html tag. Any workaround will be really appreciated. Thanks, Joan =============xsl code================= <xsl:template match="productName"> <input type="text" name="productName" value='<xsl:value-of select="."/>' size="25" maxlength="30" /> </xsl:template> =============xml code================ <?xml version="1.0"?> <productName> XML Bible </productName> =============output============== <input type="text" name="productName" value='<xsl:value-of select="."/>' size ="25" maxlength="30" /> ==========what I want============== <input type="text" name="productName" value='XML Bible' size ="25" maxlength="30" /> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: How to embed xsl:value-of into , Wendell Piez | Thread | Re: How to embed xsl:value-of into , Gary L Peskin |
Re: How to embed xsl:value-of into , rugowski | Date | Re: How to embed xsl:value-of into , Gary L Peskin |
Month |