TonyMarston
Programmer
I have a stylesheet with the following code:
As you can see for each 'column' node it examines and processes each attribute by name. Is there a way to process each attribute with an <xsl:for-each > and to obtain each attribute's name and value without having it hard-coded?
Code:
<xsl:for-each select="//structure/table/column">
<col>
<xsl:if test="@width">
<xsl:attribute name="width" ><xsl:value-of select="@width" /></xsl:attribute>
</xsl:if>
<xsl:if test="@class">
<xsl:attribute name="class" ><xsl:value-of select="@class" /></xsl:attribute>
</xsl:if>
<xsl:if test="@align">
<xsl:attribute name="align" ><xsl:value-of select="@align" /></xsl:attribute>
</xsl:if>
<xsl:if test="@valign">
<xsl:attribute name="valign" ><xsl:value-of select="@valign" /></xsl:attribute>
</xsl:if>
<xsl:if test="@char">
<xsl:attribute name="char" ><xsl:value-of select="@char" /></xsl:attribute>
</xsl:if>
<xsl:if test="@style">
<xsl:attribute name="style" ><xsl:value-of select="@style" /></xsl:attribute>
</xsl:if>
</col>
</xsl:for-each>