|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem using Key on multiple elements
Hi, Tempore 15:20:00, die 08/12/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Sreenath Juluri <jssreenath@xxxxxxxxx>: My source xml looks something like this. ... Ill-formed XML
Now in my transformed xml there should be only one element for each person irrespective of the role. for eg in the above piece of xml there shud b only one element for Michael Sinelnikoff. Try using a key like this: <xsl:key name="roleNames" match="a:xtvd/a:productionCrew/a:crew/a:member" use="concat(a:givenname,'+',a:surname)"/> and a loop like this:
<xsl:for-each select="a:xtvd/a:productionCrew/a:crew/a:member
[generate-id()=generate-id(key('roleNames',
concat(a:givenname,'+',a:surname))[1])]
/a:givenname">
</xsl:for-each>regards, -- Joris Gillis (http://users.telenet.be/root-jg/me.html) B+N N1N;N.N8N5N9N1 N:N1N9 ON? N;N,N4N9 ON,N=ON1 N2N3N1N/N=N?ON= N1OO ON,N=O B;
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








