【发布时间】:2013-11-17 13:50:49
【问题描述】:
这是我的意见
<depositAccount>
<EligibleDepAccount>
<type>DDA</type>
<market>050</market>
<number>12345678</number>
<status>Y</status>
<relationship>F-N</relationship>
<productCode>ICK</productCode>
<packageCode/>
<primaryIndicator>N</primaryIndicator>
<customer1DrivBen/>
<customer2Relationship>O-N</customer2Relationship>
<customer2DrivBen/>
<customer3Relationship/>
<customer3DrivBen/>
<customer3CifKey/>
<tierDetail>
<level>0</level>
<violationCounter>0</violationCounter>
<enrollmentDate>0</enrollmentDate>
</tierDetail>
<TIEligible>false</TIEligible>
</EligibleDepAccount>
<EligibleDepAccount>
<type>DDA</type>
<market>050</market>
<number>99999999</number>
<status>Y</status>
<relationship>F-N</relationship>
<productCode>ICK</productCode>
<packageCode>PDM</packageCode>
<primaryIndicator>N</primaryIndicator>
<customer1DrivBen/>
<customer2Relationship>O-N</customer2Relationship>
<customer2DrivBen/>
<customer3Relationship/>
<customer3DrivBen/>
<customer3CifKey/>
<tierDetail>
<level>0</level>
<violationCounter>0</violationCounter>
<enrollmentDate>0</enrollmentDate>
</tierDetail>
<TIEligible>false</TIEligible>
</EligibleDepAccount>
<EligibleDepAccount>
<type>DDA</type>
<market>050</market>
<number>12345678</number>
<status>N</status>
<productCode>KDB</productCode>
<TIEligible>false</TIEligible>
</EligibleDepAccount>
<EligibleDepAccount>
<type>DDA</type>
<market>050</market>
<number>85677833</number>
<status>N</status>
<productCode>KDB</productCode>
<TIEligible>false</TIEligible>
</EligibleDepAccount>
</depositAccount>
我需要找出相同的帐号对象并检查状态是否为 Y ,然后拉出该对象。我使用了下面的代码
<xsl:for-each-group select="$depositAccount/EligibleDepAccount" group-by="number">
<xsl:variable name="stat" select="$depositAccount/EligibleDepAccount/status/text()" />
<xsl:if test="count(current-group()) = 2">
<xsl:copy-of select="current-group()[1]"/>
</xsl:if>
<xsl:if test="count(current-group()) = 1 and $stat = 'Y'">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:for-each-group>
在上面的代码中,test="count(current-group()) = 1 and $stat = 'Y' 似乎根本不起作用。
【问题讨论】: