Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - missing something in for-each select [Thread Next] Re: missing something in for-each selectTo: NULL Date: 9/11/2009 9:13:00 AM On Fri, 11 Sep 2009 03:06:56 -0400, "Junkbox" <junkbox@f...> wrote: >Hi, > >I'm trying to get a for-each clause to work for laying out result sets and >I'm not really sure I understand why I can't get this to parse. > >The xml is basically ><result status="ok"> > <product> > <nodes...> > </product> > <product> > <nodes...> > </product> > <...> ></result> > >I'm trying to lay out the product data in a 3x3 grid format with... > ><xsl:template match="result[@status='ok']"> ><xsl:apply-templates/> ></xsl:template> > ><xsl:template match="product"> ><xsl:for-each select=".[position() mod 3 =1]"> ><...other stuff...> ></xsl:for-each> ></xsl:template> > >I can get this working other ways, but I'd like to know if someone can tell >me why the for-each statement is incorret? I'm not sure what you mean by "not working" but you need mod 3 = 0 to show rows split at multiples of 3 (0, 3, 6) and not 1 (1, 4, 7) HTH Cheers - Neil ------------------------------------------------ Digital Media MVP : 2004-2009 http://mvp.support.microsoft.com/mvpfaqs | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
