View Single Post
  #6 (permalink)  
Old April 28th, 2018, 12:17 PM
virgosaggi virgosaggi is offline
Authorized User
Points: 110, Level: 2
Points: 110, Level: 2 Points: 110, Level: 2 Points: 110, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2018
Posts: 16
Thanks: 3
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by Martin Honnen View Post
My suggestion was to simply change that one match pattern to the one I posted, the rest of your code did not need any change but need to be kept. So don't change the key declaration and simply edit that match pattern as suggested.
Hi Martin

All I did based on suggestion was below code nothing else changed

<xsl:template match="Registration[generate-id() = generate-id(key('cc', Country, ancestor::Fund)[1])]"
/>
</xsl:stylesheet>


Sample Data:
================

<FundsXML>
<Funds>
<Fund>
<Name>Fund111111</Name>
<FundFacts>
<KeyFacts>
<Registration>
<Country>AE</Country>
</Registration>
<Registration>
<Country>AE</Country>
</Registration>
<Registration>
<Country>AT</Country>
</Registration>
<Registration>
<Country>AT</Country>
</Registration>
<Registration>
<Country>TW</Country>
</Registration>
<Registration>
<Country>ZA</Country>
</Registration>
</KeyFacts>
</FundFacts>
</Fund>
</Funds>
<Fund>
<Name>Fund222222</Name>
<FundFacts>
<KeyFacts>
<Registration>
<Country>AE</Country>
</Registration>
<Registration>
<Country>AE</Country>
</Registration>
<Registration>
<Country>IT</Country>
</Registration>
<Registration>
<Country>IT</Country>
</Registration>
<Registration>
<Country>TA</Country>
</Registration>
<Registration>
<Country>ZA</Country>
</Registration>
</KeyFacts>
</FundFacts>
</Fund>
</FundsXML>
Reply With Quote