Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Duplicate XSLT Output [Thread Next] Re: Duplicate XSLT OutputTo: NULL Date: 5/4/2005 8:29:00 AM thomas wrote: > I'm building a guitar website which uses XML and XSLT. > http://www.madtim67.com/guitar/index.html You can search either by artist or > song. I used the <xsl:if test="contains(artist ,$text1)"> line which worked > OK except now I get some duplicate output (go to the website and enter 'a' > to see what I mean. I included a unique id node in my xml file to make every > record unique. Is there a way that I can check the output the unique id > field only once. > [...] > <xsl:for-each select="cat/links[contains(artist,$text1)]"> > [...] > <xsl:for-each select="cat/links[contains(song,$text1)]"> > [...] Try <xsl:apply-templates select="cat/links[contains(artist,$text1)]|cat/links[contains(song,$text1)]/"> instead of that duplicate "xsl:for-each" elements. Then, any element "cat/links[...]" should be matched just one time using <xsl:template match="cat/links[contains(artist,$text1)]|cat/links[contains(song,$text1)]"> <tr>......................</tr> </xsl:template> -- HTH Volkm@r | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
