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

Subject: [xsl] Re: How to add a attribute of XML as a html element attribute using XSLT
From: Sanjaya Liyanage <sanjayacl@xxxxxxxxx>
Date: Wed, 11 May 2011 09:09:23 +0000
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

On Wed, May 11, 2011 at 6:28 AM, Sanjaya Liyanage <sanjayacl@xxxxxxxxx>
wrote:
> ---------- Forwarded message ----------
> From: Sanjaya Liyanage <sanjayacl@xxxxxxxxx>
> Date: Wed, May 11, 2011 at 6:25 AM
> Subject: How to add a attribute of XML as a html element attribute using
XSLT
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>
>
> Hi all,
>
>        How can I use the XSLT to convert myXML.xml to target html?I
> don't know how to apply the xml property "size" as the value of
> attribute size in input element.Any help is vital.
>
>     myXML.xml
>  <ui>
>           <textBox size="50">
>           </class>
>  </ui>
>
>    Target html
>
> <html>
>    <body>
>               <input name="lastname" type="text" id="lastname"
> value="" size="50" />
>    </body>
> </html>
>
> Thank you
> Sanjaya Liyanage

Current Thread