2013-03-12 58 views
0

Expected Format Actual Format變量或參數「行」或者未規定或者超出範圍

我如何通過XSLT實現這一目標? 以上由你 (sharepoint 2010 xslt dataview : modify table structure to display list item

給出我正在從CDE錯誤時,錯誤是:變量或參數「行」要麼沒有定義,或者它是超出範圍。 請幫我爲什麼會收到此錯誤:( 我完整的代碼會是這樣的代碼後,你已經添加:

<xsl:template match='dsQueryResponse'> 
    <table cellpadding="10" cellspacing="0" border="1" style="padding:25px;"> 
    <!--table for head--> 
    <tr> 
     <!--table row--> 
     <td colspan='2'> 
     <!--table definition--> 
     <b style="font-size:25px;">ELearning List</b> 
     <!-- heading--> 
     </td> 
    </tr> 
    <xsl:apply-templates select='Rows/Row'/> 
    </table> 
</xsl:template> 
<xsl:template match='Row'> 
    <!-- template is defined above --> 
    <xsl:for-each select="$Rows[position() mod 3 = 1]"> 
    <!-- 3 recods in one row should be displayed --> 
    <tr> 
     <xsl:variable name="i" select="position() - 1" /> 
     <xsl:for-each select="$Rows[(position() &gt; ($i * 3)) and (position() &lt;= (($i + 1) * 3))]"> 
     <td> 
      <img src="../PublishingImages/FLDRNEW.GIF" width="50px" height="50px" style="padding-right:20px;"></img> 
      <!-- image is to display folder below which the hyperlinked text has been populated --> 
      <br/> 
      <a href="{@FileRef}" style="font-weight:bold;"> 
      <!-- it is the anchor tag which drives to the corresponding documents --> 
      <xsl:value-of select="substring-after(string(@FileRef),'/Docs/')"/> 
      <!-- fetches the value of Name column --> 
      </a> 
     </td> 
     </xsl:for-each> 
    </tr> 
    </xsl:for-each> 
</xsl:template> 

時的錯誤:變量或參數「行」或者未定義或者是超出範圍。 請幫

+0

在你指的是前一個線程,是在'template'與'匹配修改的XSLT = 'Row',或者它是不同的模板?該線程沒有完整的模板。 – JLRishe 2013-03-12 09:31:36

+0

現在看到的線程,並請回覆 – missReclusive 2013-03-12 10:15:47

+0

我問的是 - 在你以前的線程,你大概有東西成功工作。你能告訴我們你在這種情況下使用的完整模板嗎? – JLRishe 2013-03-12 10:27:37

回答

0

你能把這個試試嗎?

<xsl:template match='dsQueryResponse'> 
    <table cellpadding="10" cellspacing="0" border="1" style="padding:25px;"> 
    <!--table for head--> 
    <tr> 
     <!--table row--> 
     <td colspan='2'> 
     <!--table definition--> 
     <b style="font-size:25px;">ELearning List</b> 
     <!-- heading--> 
     </td> 
    </tr> 
    <xsl:apply-templates 
      select='Rows/Row[position() mod 3 = 1]' mode="group" /> 
    </table> 
</xsl:template> 

<xsl:template match='Row' mode="group"> 
    <tr> 
    <xsl:apply-templates 
      select=". | following-sibling::Row[position() &lt; 3]" /> 
    </tr> 
</xsl:template> 

<xsl:template match="Row"> 
    <td> 
    <!-- image is to display folder below which the hyperlinked text has 
      been populated --> 
    <img src="../PublishingImages/FLDRNEW.GIF" width="50px" height="50px" 
     style="padding-right:20px;" /> 
    <br/> 
    <!-- the anchor tag which drives to the corresponding documents --> 
    <a href="{@FileRef}" style="font-weight:bold;"> 
     <!-- fetches the value of Name column --> 
     <xsl:value-of select="substring-after(string(@FileRef),'/Docs/')"/> 
    </a> 
    </td> 
</xsl:template> 
+0

非常感謝!:) – missReclusive 2013-03-12 10:36:03