Re: [xsl] Can't filter the data correctly

Subject: Re: [xsl] Can't filter the data correctly
From: David Carlisle <davidc@xxxxxxxxx>
Date: Fri, 19 Sep 2003 19:49:06 +0100

  <xsl:template match="sites/site[@name='company_name']/tasks">

a template only does anything idif you apply templates to teh matching
node. In this case that is a tasks node

However you do not apply templates to taks node:

  <xsl:apply-templates select="sites/site/tasks/task"/>  

You stepped right past the tasks nodes and just apply templates
to the task node.

Without seeing your input have to gues, but I guess

<xsl:template match="sites/site[@name='company_name']/tasks/task">
  <xsl:value-of select="."/><br/>
</xsl:template>

although that only applies that template to company_name taks and will
do the default template on the others. You could zap them with
<xsl:template match="task"/>

but simpler is probably just to select the tasks you want, as you had
originally

<xsl:template match="/">
  <xsl:apply-templates select="/sites/site[@name='company_name']/tasks/task"/>
</xsl:template>


David

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread