我有以下的下拉XSLT排序列表,如果倍数仅打印字一次
<xsl:if test="bankguarantee!=0">
<li style="font-family:Arial,Arial MT,Luxi Sans,Verdana; font-size:10pt; margin:0cm 0cm 0pt; ">
<p style="font-family:Arial,Arial MT,Luxi Sans,Verdana; font-size:10pt; margin:0cm 0cm 0pt; ">
<span style="font-family:Arial,Arial MT,Luxi Sans,Verdana; font-size:11.0pt; ">The terms and conditions of <xsl:if test="bankguarantee='1'">the </xsl:if>
<xsl:if test="bankguarantee!='1'">each </xsl:if>
<xsl:for-each select="bankguarantees/bankguaranteedata">
<xsl:if test="producttypes/option[@id='A']='selected'">A</xsl:if>
<xsl:if test="producttypes/option[@id='B']='selected'">B</xsl:if>
<xsl:if test="producttypes/option[@id='C']='selected'">C</xsl:if>
<xsl:if test="producttypes/option[@id='D']='selected'">D</xsl:if>
<xsl:if test="producttypes/option[@id='E']='selected'">E</xsl:if>
<xsl:if test="producttypes/option[@id='F']='selected'">F</xsl:if>
<xsl:if test="producttypes/option[@id='G']='selected'">G</xsl:if>
<xsl:if test="producttypes/option[@id='H']='selected'"><xsl:value-of select="otherprodtypebox"/></xsl:if>
<xsl:if test="position()!=last() and position()!=last()-1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:if test="position()=last()-1">
<xsl:text> and </xsl:text>
</xsl:if>
<xsl:if test="position()=last()">
<xsl:text></xsl:text>
</xsl:if></xsl:for-each>
</xsl:if>
和下面的XML
<producttypes>
<option id="A">selected</option>
<option id="B"/>
<option id="C"/>
<option id="D"/>
<option id="E"/>
<option id="F"/>
<option id="G"/>
<option id="H"/>
</producttypes>
<otherprodtypebox/>
基本上所有工作在此刻确定,但我想避免多次发生并把所有其他的盒子放在最后。这些屏幕可以有99个。
此刻说我选择5个选项,我能得到A,B,B,otherbox和otherbox
我想如果A比一次只能显示一个选择更与同为全信它有摹
问题带有为H另一盒可以有数倍
所以你可以有
A,B,C,d,E,F,G,H,H,H, H AND H
我希望这是有道理的,任何解决方案都非常感谢。
N.B.重要的是要注意,XML是为每个屏幕创建的,所以我可以有99个不同的XML,每次都选择不同的东西。这是每个部分都很棘手的地方。也许它可以检测是否选择了多于1个A.感谢
你能告诉什么是之前和之后的'的'?也许整个''包含它? XML是否包含多个'bankguarantees'或多个'bankguaranteedata's?你提供的信息相当缺乏。您是否产生了一种情况,即您当前的方法在输出中生成重复的字母? –
JLRishe
@JLRishe我现在添加了这个。整个模板是20000行代码恐怕:( – topcat3