【发布时间】:2021-06-22 04:13:38
【问题描述】:
为变量 isSetHybridVlanValue 添加值后,我想中断循环。下面是我想要更改的部分代码
<xsl:variable name="isSetHybridVlanValue" select="0"></xsl:variable> **---I have created this flag variable---**
<xsl:variable name="hybridVlanValue">
<xsl:for-each select="$vTokens">
<xsl:if test="$isSetHybridVlanValue = 0"> **---Checking this variable if it is 0 then continue---**
<xsl:choose>
<xsl:when test="contains(current(), 'H')">
<xsl:value-of
select="normalize-space(substring-after(current(), 'H'))" />
<!-- <xsl:variable name="isSethybridVlanValue">
<xsl:value-of select="1" />
</xsl:variable> -->
</xsl:when>
<xsl:otherwise>
<xsl:if
test="contains($isHybridVlanInPortal, 'true') and count($vTokens) = 2 and $voipEnabledVlan != current()">
<xsl:value-of select="current()" />**---Once it is set I want to break this loop hence below I am trying to change existing variable to 1---**
<xsl:variable name="isSetHybridVlanValue" select = "1"/>**---It's showing error here, I want to change value of this existing variable isSetHybridVlanValue---**
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:variable>
在这里我想更新标志变量,但它不起作用。请给我建议以更新现有变量或任何其他解决方案,以便一旦为变量 hybridVlanValue 设置值,我就可以打破每个变量
【问题讨论】: