xsl-list
[Top] [All Lists]

Re: Can't filter the data correctly

2003-09-19 11:49:06


  <xsl:template match="sites/site[(_at_)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[(_at_)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[(_at_)name='company_name']/tasks/task"/>
</xsl:template>


David

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



<Prev in Thread] Current Thread [Next in Thread>