home *** CD-ROM | disk | FTP | other *** search
- <?xml version="1.0" encoding="utf-8"?>
- <!-- ===========================================================
- Category: XMLtoXML
- Author: David Silverlight
- HeadGeek@xmlpitstop.com
- Created: 2001-05-16
- Description:-
- This stylsheet will convert an xml file that is
- attribute-based to one that is element-based. In this
- stylesheet, the original customer elements are represented
- as a series of attributes. The output of this transformation
- will be a number of child elements, one for each attribute.
- ================================================================ -->
- <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
- <xsl:output method="xml"/>
- <xsl:template match="/">
- <customers>
- <xsl:for-each select="/customers/customer">
- <xsl:element name="{name()}">
- <xsl:for-each select="@*">
- <xsl:element name="{name()}">
- <xsl:value-of select="."/>
- </xsl:element>
- </xsl:for-each>
- </xsl:element>
- </xsl:for-each>
- </customers>
- </xsl:template>
- </xsl:stylesheet>