Use XPath position() function instead of xsl:number, to evaluate array indices while...
authorJamey Sharp <jamey@minilop.net>
Fri, 3 Mar 2006 07:05:08 +0000 (23:05 -0800)
committerJamey Sharp <jamey@minilop.net>
Fri, 3 Mar 2006 07:05:08 +0000 (23:05 -0800)
src/c-client.xsl

index bee7275..45e2cfe 100644 (file)
@@ -602,17 +602,17 @@ authorization from the authors.
     <l>xcb_parts[1].iov_len = -xcb_parts[0].iov_len &amp; 3;</l>
 
     <xsl:for-each select="$struct/list">
-      <l>xcb_parts[<xsl:number /> * 2].iov_base = (void *) <!--
+      <l>xcb_parts[<xsl:value-of select="position() * 2"/>].iov_base = (void *) <!--
       --><xsl:value-of select="@name" />;</l>
-      <l>xcb_parts[<xsl:number /> * 2].iov_len = <!--
+      <l>xcb_parts[<xsl:value-of select="position() * 2"/>].iov_len = <!--
       --><xsl:apply-templates mode="output-expression" /><!--
       --><xsl:if test="not(@type = 'void')">
         <xsl:text> * sizeof(</xsl:text>
         <xsl:value-of select="@type" />
         <xsl:text>)</xsl:text>
       </xsl:if>;</l>
-      <l>xcb_parts[<xsl:number /> * 2 + 1].iov_base = 0;</l>
-      <l>xcb_parts[<xsl:number /> * 2 + 1].iov_len = -xcb_parts[<xsl:number /> * 2].iov_len &amp; 3;</l>
+      <l>xcb_parts[<xsl:value-of select="1 + position() * 2"/>].iov_base = 0;</l>
+      <l>xcb_parts[<xsl:value-of select="1 + position() * 2"/>].iov_len = -xcb_parts[<xsl:value-of select="position() * 2"/>].iov_len &amp; 3;</l>
     </xsl:for-each>
 
     <l>XCBSendRequest(c, &amp;xcb_ret.sequence, <!--