OK with interpretive processor. But using XSLTC(Xalan-j-2-7-0) with following xml and xsl. It did't complete job and got error as below:
Compiler warnings: file:///C:/Testing/TestXSLTC/sample.xsl: line 11: Attribute 'settype' outside of element. file:///C:/Testing/TestXSLTC/sample.xsl: line 12: Attribute 'setid' outside of element. ---------------------------------------------------------------------------- ------------------- <?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:for-each select="//country"> <xsl:choose> <xsl:when test="@name"> <xsl:element name="AAAA"> <xsl:for-each select="."> <xsl:attribute name="option"><xsl:value-of select="."/></xsl:attribute> </xsl:for-each> <xsl:attribute name="settype"><xsl:text>columnar</xsl:text></xsl:attribute> <xsl:attribute name="setid"><xsl:value-of select="*"/></xsl:attribute> </xsl:element> </xsl:when> </xsl:choose> </xsl:for-each> </xsl:template> </xsl:stylesheet> ---------------------------------------------------------------------------- --------------------------- <?xml version="1.0" encoding="UTF-8"?> <countries> <country name="France"/> <country name="USA" selected="yes"/> <country name="USSA"/> </countries>