xsl-list
[Top] [All Lists]

Need help correcting XSL

2005-07-19 08:07:04
Hi,
  Below I have an example that has two tables with a
slide different value in the attribute of the
listFilter.  I want to get the item that match BOTH
item='AAA' and listFilter='hot' but the result I got
is a 'HELLO' string from both tables.  The output I
really want to see is just a 'HELLO' string from the
first table since it's matched both of the conditions
(item='AAA' and listFilter='hot').  But instead I got
two 'HELLO'.  I guest I got the second 'HELLO' because
of the match of the listFilter='none' from the second
table. I don't want the second 'HELLO'.  I've been
struggled trying to get this resolve but no luck. 
Please help.  I don't know to fix it.  See below
example. 

Your help will greatly appreciated.  Thank you.


XSLT:

<table>  
   <xsl:apply-templates
select="Reports/report[item='AAA' and
item/@listFilter='hot']">
      <xsl:sort select="*[name() = $sortBy]"
order="ascending" />
   </xsl:apply-templates>
</table>
 
<table>
   <xsl:apply-templates
select="Reports/report[item='AAA' and
item/@listFilter='none']">
      <xsl:sort select="*[name() = $sortBy]"
order="ascending" />
   </xsl:apply-templates>
</table>

<xsl:template match="report">
  <tr>
    <td>  <xsl:value-of select="name"/> </td>
  </tr>
</xsl:template>

   

XML:

<Reports>
   <report>
      <message>Hello</message>
      <myList>          
          <item listFilter='hot'>AAA</item>
          <item listFilter='none'>BBB</item>
      <myList>
   </report>
</Reports>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



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