[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Need help correcting XSL

Subject: Need help correcting XSL
From: Henry Dong <hdong_us@xxxxxxxxx>
Date: Tue, 19 Jul 2005 08:07:04 -0700 (PDT)
henry dong
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 

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.