is there a way to convert all nodes\' attributes into child Nodes using XSLT 1.0
?
It must run flawlessly with PHP\'s xsltProcessor
. The attributes
Tested on Oxygen/XML using Saxon6.5:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="@*">
<xsl:element name="{name()}"><xsl:value-of select="."/></xsl:element>
</xsl:template>
</xsl:stylesheet>
This is based on using an identity template for element nodes and a template that converts attributes to elements.