我有以下的下拉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