0
我試圖在XSLT下拉列表中設置預選值。因此,如果結果答案已填充XSLT下拉列表中的默認值
這是有效的,但我只在其中一個提示中設置了結果答案,然後將其設置爲任何其他後續的下拉列表,其中也包含應答的結果。
<xsl:if test="count(PromptOutcomes/PromptOutcome/Outcome) > 3">
<div class="promptText">
<select class="promptOutcomes" name="PromptOutcomes" tag="{ID}" id="PromptResponse">
<xsl:for-each select="PromptOutcomes/PromptOutcome">
<xsl:variable name="outcomeAnswer" select="//AnsweredOutcome"></xsl:variable>
<option value="{Outcome}" tag="PromptResponse">
<xsl:choose>
<xsl:when test="Outcome = $outcomeAnswer">
<xsl:attribute name="selected">
selected
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="Outcome"/>
</option>
</xsl:for-each>
</select>
</div>
</xsl:if>
</div>
的Xml
<Prompt>
<DateOfAnswer>2014-09-05T15:08:00</DateOfAnswer>
<ID>226</ID>
<SelectedOutcome/>
<AnsweredOutcome>Lead Generated passed to SLD</AnsweredOutcome>
<PromptOutcomes>
<PromptOutcome>
<Outcome/>
</PromptOutcome>
<PromptOutcome>
<Outcome>No</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Not Interested</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Interested but no follow up</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Lead Generated passed to SLD</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Interested referred to IFA</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Customer Unhappy do not ask again</Outcome>
</PromptOutcome>
</PromptOutcomes>
<PromptMessage>Does the customer have pensions elsewhere they'd like to consolidate with Standard Life?</PromptMessage>
<ChildMessages/>
<PromptType>Opportunity</PromptType>
<Link>ConsolidationGuide</Link>
<Priority>22</Priority>
</Prompt>
<Prompt>
<DateOfAnswer xsi:nil="true"/>
<ID>227</ID>
<SelectedOutcome/>
<PromptOutcomes>
<PromptOutcome>
<Outcome/>
</PromptOutcome>
<PromptOutcome>
<Outcome>In new employers scheme</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Left Employer</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Restart customer/employer contributions</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>No restart of customer/employer contributions</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Customer Unhappy do not ask again</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Plan Updated to Direct</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Not Interested</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>No other pensions</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Interested but no follow up</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Lead Generated passed to SLD</Outcome>
</PromptOutcome>
<PromptOutcome>
<Outcome>Interested referred to IFA</Outcome>
</PromptOutcome>
</PromptOutcomes>
<PromptMessage>Possible workplace leaver</PromptMessage>
<ChildMessages>
<PromptMessage>
<Message>Does the customer have any other pensions?</Message>
</PromptMessage>
<PromptMessage>
<Message>Has customer left employer?</Message>
</PromptMessage>
<PromptMessage>
<Message>Restart customer/employer payments?</Message>
</PromptMessage>
</ChildMessages>
<PromptType>Opportunity</PromptType>
<Priority>23</Priority>
</Prompt>
所以下拉列表中的第2個提示選擇甚至儘管它沒有一個回答的結果。我嘗試添加一個否則,並將選定的屬性設置爲其他東西,但也沒有工作。
良好,即工作。非常感謝你。 – 2014-09-08 08:58:22