Thursday, May 19, 2011

How to add a attribute of XML as a html element attribute using XSLT

Once you work with XSLT you may come across a situation where you need to directly apply a value of a XML attribute as the value of a HTML attribute.There are two options to figure the things out.

myXML.xml










Target html










In the above case the value of the attribute boxSize is directly applied as the value of the attribute size of input element in HTML format.This can be achieved as below two methods.

method 1











method 2




As you see method 2 is more easy and it is the simple way to get the job done.Thank you.Hope this helps.

No comments:

Post a Comment