xsl-list
[Top] [All Lists]

xsl looping 2 siblings help

2005-06-23 00:00:18
this is my sample xml 
<root> 
 <artist> 
   <name>Jackson</name> 
   <songlist> 
     <songs> 
        <sid>001</sid> 
        <sname>Sample 1</sname> 
     </songs> 
     <songs> 
        <sid>002</sid> 
        <sname>Sample 2</sname> 
     </songs> 
   </songlist> 
   <genrelist> 
      <genre> 
         <gid>001</gid> 
         <gname>Rock</gname> 
      </genre> 
      <genre> 
         <gid>002</gid> 
         <gname>R&B</gname> 
      </genre> 
   </genrelist> 
 </artist> 

 <artist> ....... and it goes </artist> .... 
</root> 

now how can i loop throug artist by filtering them according to genre
and then list name and all the songs of each artist

i have something like: 
<xsl:parse> 
<xsl:stylesheet> 
<xsl: template match:"root"> 
  < xsl:for-each select="artist"> 
     <xsl:for-each select="genrelist/genre"> 
       < xsl:if test="gid='001'"> 
         < xsl:valueOf select="name"> 
         <xsl:for-each select="songlist/songs"> 
         <xsl:valueOf select="sname">  
    end .....
 
but the songs list doesnt display.  so my problem is looping a node
inside its sibling
thnks

-- 
*-::jay::-*

--~------------------------------------------------------------------
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>
  • xsl looping 2 siblings help, -= jay =- <=