<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/complexType">
<Asset id="<xsl:value-of select="@name" />">
<EntryInheritance
id="base"
AssetType="<xsl:value-of select="complexContent/extension/@base" />"
/>
<xsl:for-each select="complexContent/extension/*">
<xsl:choose>
<xsl:when test="ends-with(@type, 'Ref')">
<EntryReference
id="<xsl:value-of select="@name" />"
AssetType="<xsl:value-of select="substring(@type, 1, string-length(@type) - 3)" />"
IsAttribute="true"/>
</xsl:when>
<xsl:when test="ends-with(@type, 'Id')">
<Entry
id="<xsl:value-of select="@name" />"
AssetType="String"
IsAttribute="true"
Default="<xsl:value-of select="@default" />" />
</xsl:when>
<xsl:otherwise>
<Entry
id="<xsl:value-of select="@name" />"
AssetType="<xsl:value-of select="@name" />"
IsAttribute="true"
Default="<xsl:value-of select="@default" />" />
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</Asset>
</xsl:template>
</xsl:stylesheet>