xsl-list
[Top] [All Lists]

AW: XSL newbie help needed

2004-09-16 06:57:30
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 


<Prev in Thread] Current Thread [Next in Thread>
  • AW: XSL newbie help needed, christof.hoeke <=