xsl-list
[Top] [All Lists]

Re: [xsl] Re: How to add a attribute of XML as a html element attribute using XSLT

2011-05-11 04:44:51
On 11/05/2011 10:09, Sanjaya Liyanage wrote:
Hi all,

        I figured it out in the below way.

      <xsl:for-each select="ui/textBox">
          <input name="lastname" type="text" id="llastname" value="">
              <xsl:attribute name="size">
                        <xsl:value-of select="@size" />
               </xsl:attribute>
          </input>
     </xsl:for-each>

Thank you.
Sanjaya Liyanage

which works but is rather verbose

 <xsl:for-each select="ui/textBox">
 <input
 name="lastname" type="text" id="llastname" value="" size="{@size}"/>
</xsl:for-each>

is shorter

David



________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. ________________________________________________________________________

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>