1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:xdt="http://www.w3.org/2005/xpath-datatypes">
<xsl:output indent="yes"/>
<xsl:template match="/Racine">
<xsl:element name="Racine">
<xsl:element name="declarations">
<xsl:element name="attributeDecl">
<xsl:attribute name="name">Name</xsl:attribute>
<xsl:attribute name="type">String</xsl:attribute>
</xsl:element>
<xsl:for-each select="LEVEL/LEVEL/SIZE">
<xsl:element name="attributeDecl">
<xsl:attribute name="Name">
<xsl:value-of select="@name">
</xsl:value-of>
</xsl:attribute>
<xsl:attribute name="Type">Float</xsl:attribute>
</xsl:element>
<xsl:for-each select="COLOR/NAME">
<xsl:element name="attributeDecl">
<xsl:attribute name="Name">
<xsl:value-of select="@value">
</xsl:value-of>
</xsl:attribute>
<xsl:attribute name="Type">Float</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</xsl:element>
<xsl:element name="branch">
<xsl:element name="attribute">
<xsl:attribute name="name">Name</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="/Racine/LEVEL/VALUE"></xsl:value-of>
</xsl:attribute>
<xsl:element name="leaf">
<xsl:for-each select="/Racine/LEVEL/LEVEL">
<xsl:element name="attribute">
<xsl:attribute name="name">Name</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="VALUE"/>
</xsl:attribute>
</xsl:element>
<xsl:for-each select="SIZE">
<xsl:element name="attribute">
<xsl:attribute name="name">
<xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="VALUE"/>
</xsl:attribute>
</xsl:element>
<xsl:for-each select="COLOR/NAME">
<xsl:element name="attribute">
<xsl:attribute name="name">
<xsl:value-of select="@value"/>
</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="VALUE"/>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet> |
Partager