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

Subject: Re: [xsl] Re: How to add a attribute of XML as a html element attribute using XSLT
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 11 May 2011 10:44:20 +0100
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. ________________________________________________________________________


Current Thread