1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/DataCenters/External"> <dataRoot xml:id="myRemoteData-treeRootNode"> <xsl:for-each select="CenterID"> <dataCenter name="{@name}" desc="{@desc}" group="{@group}"> <xsl:if test="@default"> <xsl:attribute name="default"> <xsl:value-of select="@default"/> </xsl:attribute> </xsl:if> <xsl:attribute name="id1"><xsl:value-of select="."/></xsl:attribute> <xsl:attribute name="xml:id"><xsl:value-of select="."/></xsl:attribute> </dataCenter> </xsl:for-each> </dataRoot> </xsl:template> </xsl:stylesheet>