[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Merging XML from Lookup table


Subject: [xsl] Merging XML from Lookup table
From: "Tracy" <amit.shukla@xxxxxxxxxxx>
Date: Sun, 22 Feb 2004 10:37:27 -0800

I have an XML in which data is coming from one source and another XML which
contains the matching IDs and their format is completely different (I can
modify the format if it doesn't work for the solution). I need to generate
an XML with matching IDs. But have no idea how to do that. Please help me.

Data.xml
////////////////////////////////////////////////////////////
<data>
	<customer>
		<row num="2" zip="56780" typeID="1" />
		<row num="3" zip="98264" typeID="1" />
		<row num="5" zip="45424" typeID="2" />
		<row num="1" zip="45722" typeID="1" />
		<row num="4" zip="75565" typeID="2" />
	</customer>
</data>
////////////////////////////////////////////////////////////

table.xml
////////////////////////////////////////////////////////////
<tables>
<table name="customer">
	<data>
		<row num="1" name="Kate Hudson" />
		<row num="2" name="Jon Wright" />
		<row num="3" name="Craig Wills" />
		<row num="4" name="Ben Stills" />
		<row num="5" name="Le Yan" />
		<row num="6" name="Mc Kin" />
		<row num="7" name="Vincent Dsouza" />
	</data>
</table>
<table name="customer">
	<data>
		<row typeID="1" type="Lease" />
		<row typeID="2" type="Hire" />
	</data>
</table>
</tables>
////////////////////////////////////////////////////////////

output.xml
////////////////////////////////////////////////////////////
<data>
	<customer>
		<row name="Jon Wright" zip="56780" type="Lease" />
		<row name="Craig Wills" zip="98264" type="Lease" />
		<row name="Le Yan" zip="45424" type="Hire" />
		<row name="Kate Hudson" zip="45722" type="Lease" />
		<row name="Ben Stills" zip="75565" type="Hire" />
	</customer>
</data>
////////////////////////////////////////////////////////////


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml