Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: missing something in for-each select

From: "Neil Smith [MVP Digital Media]" <neil@------.--->
To: 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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent