Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

find intersection of xml files using xslt

Status
Not open for further replies.

zalim30

Programmer
Oct 13, 2005
17
GB
Hi there
I want to find the intersection of two xml files using XSLT. Plz see the following example as help.

<?xml version="1.0"?>
<root>
<object ID ="1" name = "abc" price = "0"/>
<object ID ="2" name = "def" price = "430"/>
<object ID ="3" name = "abc" price = "350"/>
<object ID ="4" name = "def" price = "3000"/>
<object ID ="5" name = "jkl" price = "130"/>
<object ID ="6" name = "abc" price = "230"/>
</root>
****************************************************
File2.xml
<?xml version="1.0"?>
<root>
<object ID ="1" name = "abc" price = "0"/>
<object ID ="2" name = "def" price = "430"/>
<object ID ="4" name = "defijk" price = "3000"/>
<object ID ="50" name = "jkl" price = "130"/>
<object ID ="7" name = "abc" price = "2"/>
<object ID ="17" name = "xyz" price = "2"/>
</root>
***********************************************
result.xml
<?xml version="1.0"?>
<root>
<object ID ="1" name = "abc" price = "0"/>
<object ID ="2" name = "def" price = "430"/>
</root>

So as you can see, only those elements are retained whose attributes exactly matched in value...
I think that will help explain the problem....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top