Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: data set operation - remove nodes from one data set that have nodes that exist in another data set >Thread Next - Re: data set operation - remove nodes from one data set that have nodes that exist in another data set Re: data set operation - remove nodes from one data set that have nodes that exist in another data setTo: NULL Date: 7/27/2008 6:47:00 PM vanSkier wrote: > SOURCE DATA > ----------- > > <datasets> > > <dataset set="1"> > <data>Company 1</data> > <data>Company 2</data> > <data>Company 3</data> > <data>Company 4</data> > <data>Company 5</data> > </dataset> > > > <dataset set="2"> > <data>Company 1</data> > <data>Company 2</data> > <data>Company 5</data> > </dataset> > > </datasets> > > > > > RESULT DATA > ----------- > > <datasets> > > <dataset set="result"> > <data>Company 3</data> > <data>Company 4</data> > </dataset> > > </datasets> Here is an XSLT stylesheet that produces the described result: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:template match="datasets"> <xsl:copy> <dataset set="result"> <xsl:copy-of select="dataset[@set = '1']/data[not(. = /datasets/dataset[@set = '2']/data)]"/> </dataset> </xsl:copy> </xsl:template> </xsl:stylesheet> -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
