如何在XSLT中使用for-each迭代java ArrayList对象?

时间:2013-06-11 07:08:52

标签: xslt xslt-1.0 apache-fop

我在使用XSLT中的for-each迭代java arraylist对象时遇到了问题。

下面是我用于迭代的代码。 $ dtoList 有ArrayList对象。

<xsl:for-each  select="$dtoList">
                                <xsl:variable name="dto" select="." />

                                    <fo:table-row>
                                        <fo:table-cell padding="1mm" border="solid 1px black">
                                            <fo:block font-weight="bold" >
                                                <xsl:value-of select="subHistory:getFieldLabel($historyInstance,$dto)"></xsl:value-of>
                                            </fo:block>
                                        </fo:table-cell>
                                        <fo:table-cell padding="1mm" border="solid 1px black">
                                            <fo:block>
                                                <xsl:value-of select="subHistory:getFieldValue($historyInstance,$dto)"></xsl:value-of>
                                            </fo:block>
                                        </fo:table-cell>
                                    </fo:table-row>
                                </xsl:for-each>

我收到以下异常

ERROR:  'Error checking type of the expression 'com.sun.org.apache.xalan.internal.xsltc.compiler.ForEach@59d5a6'.'
FATAL ERROR:  'Could not compile stylesheet'
2013-06-11 12:33:38,254 ERROR [[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'] (HistoryBean.java:452) - Could not compile stylesheet
javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:828)
    at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:617)
    at weblogic.xml.jaxp.WebLogicTransformerFactory.newTransformer(WebLogicTransformerFactory.java:230)
    at weblogic.xml.jaxp.RegistryTransformerFactory.newTransformer(RegistryTransformerFactory.java:209)

感谢任何帮助。

谢谢&amp;问候, RaoPotla

0 个答案:

没有答案