1 <?xml version="1.0" encoding="ISO-8859-15" ?>
3 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
5 <!-- get-dirname: get directory part of file $path-->
8 <xsl:param name="path">
9 <xsl:for-each select="ancestor::build">
10 <xsl:call-template name="get-dirname">
11 <xsl:with-param select="@base" name="path"/>
17 <xsl:template name="get-dirname">
18 <xsl:param name="path"/>
20 <xsl:when test="contains($path, '/')">
22 <xsl:when test="substring($path, string-length($path)) != '/'">
23 <xsl:call-template name="get-dirname">
24 <xsl:with-param select="substring($path, 1, string-length($path)-1)" name="path"/>
28 <xsl:value-of select="$path"/>
33 <xsl:message terminate="yes">
34 No valid relative path
40 <!-- return value: 0=found, 1=not found -->
41 <xsl:template name="resolve-condition">
42 <xsl:param name="expression"/>
43 <xsl:param name="confexpr">CONFIG_<xsl:value-of select="$expression"/></xsl:param>
46 <xsl:when test="$expression!=''">
47 <xsl:variable name="value"><xsl:value-of select="document('config.xml',.)//option[@name=$confexpr]/attribute::value"/></xsl:variable>
48 <xsl:variable name="type"><xsl:value-of select="document('config.xml',.)//option[@name=$confexpr]/attribute::type"/></xsl:variable>
50 <xsl:when test="$type='boolean'">
52 <xsl:when test="$value='true'"><xsl:text>0</xsl:text></xsl:when>
53 <xsl:when test="$value='false'"><xsl:text>1</xsl:text></xsl:when>
54 <!-- boolean but no value is false -->
55 <xsl:when test="$value=''"><xsl:text>1</xsl:text></xsl:when>
57 <xsl:message terminate="yes">Error:<xsl:value-of select="$confexpr"/> has no valid value '<xsl:value-of select="$value"/>'.</xsl:message>
62 <!-- if it doesn't exist, it is false -->
63 <xsl:when test="$type=''"><xsl:text>1</xsl:text></xsl:when>
65 <xsl:message terminate="yes">Error:<xsl:value-of select="$confexpr"/> is not a boolean value ('<xsl:value-of select="$type"/>').</xsl:message>
70 <xsl:value-of select="$confexpr"/> = <xsl:value-of select="$value"/>
74 <!-- if no expression is there we return true -->
75 <xsl:otherwise>0</xsl:otherwise>