Debian Codegraph @

data/level-transform.xsl

raw
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3 <xsl:output indent="yes"/>
4 <xsl:strip-space elements="*"/>
5 <xsl:template match="@*|node()">
6 <xsl:copy>
7 <xsl:apply-templates select="@*|node()"/>
8 </xsl:copy>
9 </xsl:template>
10
11 <xsl:template match="environment">
12 <environment n_columns="{n_columns/text()}" n_rows="{n_rows/text()}">
13 <xsl:apply-templates />
14 </environment>
15 </xsl:template>
16 <xsl:template match="scenario">
17 <scenario n_columns="{n_columns/text()}" n_rows="{n_rows/text()}">
18 <xsl:apply-templates />
19 </scenario>
20 </xsl:template>
21 <xsl:template match="goal">
22 <goal n_columns="{n_columns/text()}" n_rows="{n_rows/text()}">
23 <xsl:apply-templates />
24 </goal>
25 </xsl:template>
26 <xsl:template match="row">
27 <xsl:apply-templates />
28 </xsl:template>
29 <xsl:template match="col">
30 <position>
31 <xsl:attribute name="row">
32 <xsl:value-of select="../@no" />
33 </xsl:attribute>
34 <xsl:attribute name="col">
35 <xsl:value-of select="@no" />
36 </xsl:attribute>
37 <xsl:apply-templates />
38 </position>
39 </xsl:template>
40 <xsl:template match="tile">
41 <tile type="{type/text()}" base="{base/text()}">
42 <xsl:apply-templates />
43 </tile>
44 </xsl:template>
45 <xsl:template match="n_columns|n_rows|type|base"/>
46
47 </xsl:stylesheet>