I want to display the value of name by using the static attribute. In other words, I want the value of static to be the element that is displayed. Is it possible?
Created May 4, 2012
Shamith Hamid Assume that you have the follwoing XML:
<?xml version="1.0" encoding="UTF-8"?> <xml> <name>Hello</name> <att1 static="name"/> </xml>then the following XSL will produce the required output:
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:value-of select="xml/*[name() = /xml/att1/@static]" /> </xsl:template> </xsl:stylesheet>