首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >变量未赋值

问变量未赋值
EN

Stack Overflow用户
提问于 2014-03-16 20:33:47
回答 1查看 61关注 0票数 0

现在,我正在尝试将一个模板保存到变量DatumMoves中。在调试器中运行时,它跳过DatumMoves的变量,但在没有分配给变量时执行得很好。

代码语言:javascript
复制
                <xsl:variable name="SlaveMoves">
                <xsl:call-template name="ReadFiles">
                    <xsl:with-param name="FileType" select="'Slave'"/>
                    <xsl:with-param name="Activities" select='$slavefile/OLPData/Resource/ActivityList/Activity'/>
                    <xsl:with-param name="GH_IML_EE" select="$GH_IML_EE"/>
                </xsl:call-template>
            </xsl:variable>
            <!--LOOP THROUGH THE OPERATIONS AND DO A RECURSIVE CALL TO COMBINE ROBOTS-->
            <xsl:for-each select="$MasterMoves/Operation">
                <xsl:copy><xsl:copy-of select="@*"/>
                    <!--<Relocation>
                        <xsl:variable name="relocation" select="$DatumFile/CellProgram/WorkSequence/Operation/Block[@Type = 'WORK' and not(RobotPoint[@Process='NOP'])]"/>
                        <xsl:for-each select="$relocation/RobotPoint">
                            <xsl:copy>
                                <xsl:element name="Target">
                                    <xsl:copy-of select="@RobotIndex"/>
                                    <xsl:copy-of select="Data/@Location"/>
                                </xsl:element>
                            </xsl:copy>
                        </xsl:for-each>
                    </Relocation>-->
                    <xsl:variable name="DatumMoves">
                        <xsl:call-template name="process-next">
                            <xsl:with-param name="mastermoves" select='Move' tunnel='yes'/>
                            <xsl:with-param name="slavemoves" select='$SlaveMoves/Operation[@Name=current()/@Name]/Move' tunnel='yes'/>
                        </xsl:call-template>
                    </xsl:variable>
                    <Options RobotIndex="1"><xsl:copy-of select="Options/@*"/></Options>
                    <Options RobotIndex="2"><xsl:copy-of select="$SlaveMoves/Operation[@Name=current()/@Name]/Options/@*"/></Options>
                    <xsl:call-template name="process-next">
                        <xsl:with-param name="mastermoves" select='Move' tunnel='yes'/>
                        <xsl:with-param name="slavemoves" select='$SlaveMoves/Operation[@Name=current()/@Name]/Move' tunnel='yes'/>
                    </xsl:call-template>
                </xsl:copy>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-03-16 21:39:03

确保变量值在某个地方使用,否则XSLT处理程序完全可以不计算其值。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22442595

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档