AW: [xsl] XSL newbie help needed

Subject: AW: [xsl] XSL newbie help needed
From: <christof.hoeke@xxxxxxx>
Date: Thu, 16 Sep 2004 15:57:30 +0200
just use an xsl:variable or xsl:param if you want to control it from outside
the template, see below:


> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
> xmlns:mdc="http://us.mil.dcgs/metadata";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

<xsl:param name="maker">ford</xsl:param> <!-- ford is default if no param
given -->

> <xsl:template match="/">
> <xsl:for-each select="descendant::xsd:element">
> <xsl:if test="contains(@substitutionGroup,'car')">
> <xsl:value-of select="@type"/><xsl:text> </xsl:text>
> </xsl:if>

<!--
> <xsl:if test="contains(@substitutionGroup,'ford')">    
-->

<xsl:if test="contains(@substitutionGroup, $maker)">    

<!--
> ford should
> not be hard coded -->

> <xsl:value-of select="@substitutionGroup"/>-<xsl:value-of
> select="@type"/> <xsl:text> </xsl:text>
> </xsl:if>
> </xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
>

cheers
chris

Current Thread