我正在处理一个不断丢失地址行的 xsl 文档。我已经修复了它,但似乎已经破坏了它试图修复与修复相关的问题。这是我的代码中的一个示例:
.
<addressLine2>
<xsl:choose>
<xsl:when test="number($houseNameNumberNumericCharacterLength) >= number($houseNameNumberNonNumericCharacterLength)">
<xsl:value-of select="mad:Address/mad:AddressLineTwo"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$addressLineOne"/>
</xsl:otherwise>
</xsl:choose>
</addressLine2>
<addressLine3>
<xsl:choose>
<xsl:when test="addressLine2 != '$addressLineOne'">
<xsl:value-of select="$addressLineThree"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$addressLineTwo"/>
</xsl:otherwise>
</xsl:choose>
</addressLine3>
<addressLine4>
<xsl:choose>
<xsl:when test="addressLine3 = ($addressLineTwo)">
<xsl:value-of select="$addressLineThree"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="mad:Address/mad:AddressLineFour"/>
</xsl:otherwise>
</xsl:choose>
</addressLine4>
您可以假设 AddressLine2 始终映射到变量 $addressLineOne。AddressLine2 工作正常。我遇到的问题是地址线 3。我测试
when addressLine2 = $addressLineOne
然后choose value $addressLineThree
但是地址出来是这样的:
Line1: (mapped from houseNumberHouseName)
Line2: $AddressLineOne
Line3: $AddressLineThree
Line4: /
我需要的是:
Line1: (mapped from houseNumberHouseName)
Line2: $AddressLineOne
Line3: $AddressLineTwo
Line4: $AddressLineThree
当 AddressLine1 不是从 houseNumberHouseName 映射时:
Line1: $AddressLineOne
Line2: $AddressLineTwo
Line3: $AddressLineThree
Line4: /
有人可以指出为什么我的选择不起作用吗?
谢谢