Carsten Milkau schrieb: > below), I will have a look at the transformation stylesheet you > provided and see if I can improve it. :)
What do you think about this patch (see attachment)? Carsten
Index: pingusv1tov2.xsl =================================================================== --- pingusv1tov2.xsl (Revision 2456) +++ pingusv1tov2.xsl (Arbeitskopie) @@ -19,13 +19,16 @@ <version>2</version> <head> <xsl:apply-templates select="global/*|action-list"/> + <xsl:if test="count(global/music) = 0"> + <music>none</music> + </xsl:if> <levelsize> <width><xsl:value-of select="/pingus-level/global/width" /></width> <height><xsl:value-of select="/pingus-level/global/height" /></height> </levelsize> </head> <objects> - <xsl:apply-templates select="background|exit|entrance|hotspot|worldobj|liquid|group"/> + <xsl:apply-templates select="background|exit|entrance|hotspot|worldobj|liquid|group|groundpiece"/> </objects> </pingus-level> </xsl:template> @@ -58,7 +61,16 @@ <xsl:with-param name="text" select="concat(translate($datafile, '-', '/'), '/', $ident)" /> </xsl:call-template> </image> - <modifier><xsl:value-of select="modifier" /></modifier> + <modifier> + <xsl:choose> + <xsl:when test="string(modifier) != ''"> + <xsl:value-of select="modifier" /> + </xsl:when> + <xsl:otherwise> + <xsl:text>ROT0</xsl:text> + </xsl:otherwise> + </xsl:choose> + </modifier> </xsl:template> <xsl:template name="replace-alias"> @@ -125,4 +137,18 @@ <xsl:template match="z-pos"> <z><xsl:apply-templates /></z> </xsl:template> + + <xsl:template match="groundpiece"> + <groundpiece> + <type><xsl:value-of select="@type"/></type> + <xsl:apply-templates select="*"/> + </groundpiece> + </xsl:template> + + <xsl:template match="surface|position"> + <xsl:copy> + <xsl:apply-templates select="*"/> + </xsl:copy> + </xsl:template> + </xsl:stylesheet>
_______________________________________________ Pingus-Devel mailing list Pingus-Devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/pingus-devel