Mega Code Archive

 
Categories / XML Tutorial / XSLT StyleSheet
 

The attribute starts with format identificator followed by separator characters

File: Data.xml <?xml version="1.0" encoding="utf-8"?> <data>           <n>one</n>     <n>two</n>     <n>three</n>     <n>four</n> </data> File: Transform.xslt <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet       version="1.0"       xmlns:xsl="http://www.w3.org/1999/XSL/Transform">     <xsl:template match="/">       <TABLE>         <xsl:for-each select="//n">           <TR>             <TD>               <xsl:number value="position()" format="A   "/>               <xsl:value-of select="."/>             </TD>           </TR>         </xsl:for-each>       </TABLE>     </xsl:template> </xsl:stylesheet> Output: <?xml version="1.0" encoding="UTF-8"?><TABLE><TR><TD>A   one</TD></TR><TR><TD>B   two</TD></TR><TR><TD>C   three</TD></TR><TR><TD>D   four</TD></TR></TABLE>