Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: data set operation - remove nodes from one data set that have nodes that exist in another data set

From: vanSkier <rod_Kane@-------.--->
To: NULL
Date: 7/27/2008 9:38:00 AM
On Jul 27, 4:07=A0am, "Joe Fawcett" <joefawc...@newsgroup.nospam> wrote:
> "vanSkier" <rod_K...@hotmail.com> wrote in message
>
> news:93194946-7233-430e-a8d1-23d6442c1cdc@f......=
> Hello,
>
> > I'd like to uses xsl to process one set of nodes and for each node
> > that exists in that data set: =A0determine if that node exists in a
> > second set of nodes and if it exists there remove it from the first
> > data set.
>
> > Does any one have any ideas on the most efficient way to approach
> > this? =A0If anyone has seen an example of this I'd much appreciate the
> > url where it's demonstrated.
>
> > Than you very much.
>
> > Rod
>
> If I were doing this in XSLT I'd use one of the documents as the source a=
nd
> bring the reference one in via the document() function.
> Then I'd copy all nodes except the referenced ones. The difficulty would =
be
> to determine the matching nodes, can you show a small example of the two
> documents and the output you need?
>
> The second question is you say you are using a data set, does this mean a=
n
> ADO.NET dataset rather than XML files?
>
> --
>
> Joe Fawcett (MVP - XML)http://joe.fawcett.name



Thanks Joe.  Here's an example below, if an item of set 2 is found in
set 1 then remove if from set 1.

I'm relatively new to xsl and see there's a key function and maybe
that could be used do determine which nodes to copy.

The source could be a relational store but was trying to be safe and
build this agnostic to source.

Rod



SOURCE DATA
-----------

<datasets>

     <dataset set=3D"1">
	<data>Company 1</data>
	<data>Company 2</data>
	<data>Company 3</data>
	<data>Company 4</data>
	<data>Company 5</data>
     </dataset>


     <dataset set=3D"2">
	<data>Company 1</data>
	<data>Company 2</data>
	<data>Company 5</data>
     </dataset>

</datasets>




RESULT DATA
-----------

<datasets>

     <dataset set=3D"result">
	<data>Company 3</data>
	<data>Company 4</data>
     </dataset>

</datasets>



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent