Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: selecting nested distinct records -- Help XSLT: selecting nested distinct records -- HelpTo: NULL Date: 10/3/2004 12:01:00 PM I'm just learning XSLT and am currently stuck trying to solve the following problem. My XML looks like this: <resultset> - <record> <field name="vchAdmin">XXX</field> <field name="vchRoot">1</field> </record> - <record> <field name="vchAdmin">YYY</field> <field name="vchRoot">1</field> </record> - <record> <field name="vchAdmin">YYY</field> <field name="vchRoot">2</field> </record> - <record> <field name="vchAdmin">YYY</field> <field name="vchRoot">2</field> </record> - <record> <field name="vchAdmin">ZZZ</field> <field name="vchRoot">1</field> </record> - <record> <field name="vchAdmin">ZZZ</field> <field name="vchRoot">1</field> </record> <resultset> What I need to achieve is to count # of DISTINCT vchRoot's PER vchAdmin and place that into a different XML format. In this case, my output has to be: <resultset> <record> <vchAdmin>XXX</vchAdmin> <iDistinctRoots>1</iDistinctRoots> </record> <record> <vchAdmin>YYY</vchAdmin> <iDistinctRoots>2</iDistinctRoots> </record> <record> <vchAdmin>ZZZ</vchAdmin> <iDistinctRoots>1</iDistinctRoots> </record> </resultset> I've tried using nested keys to first get distinct vchAdmin's and then get and count distinct vchRoots for each vchAdmin but nothing seems to work. Please help? Thank you in advance!! XSLT Newby | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
