XSL stylesheet 2<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> |
<xsl:template match="*"> |
<xsl:copy select="."> |
<xsl:attribute name="id"> |
<xsl:value-of select="generate-id()"/> |
</xsl:attribute> |
<xsl:for-each select="@*"> |
<xsl:attribute name="{name()}"> |
<xsl:value-of select="."/> |
</xsl:attribute> |
</xsl:for-each> |
<xsl:apply-templates/ > |
</xsl:copy> |
</xsl:template> |
</xsl:stylesheet> |