Hi,
I am trying to generate a table of output derived from two xmls using document() function in XSLT.
I have two xmls attached (xml1.txt), (xml2.txt).
I would like to get a key list of dates from both XMLs and align the data in a table in the output. Sometimes it is possible that the date Entry in first xml may not have a corresponding date entry in the second XML and vice versa.
xml1
Code:
<?xml version="1.0" encoding="utf-8"?>
<Items>
<Item>
<Date>
10/12/2010
</Date>
<Name>
A1
</Name>
<FathersName>
A
</FathersName>
<Address>xxx</Address>
<Occupation>Engineer</Occupation>
</Item>
<Item>
<Date>
10/15/2010
</Date>
<Name>
A2
</Name>
<FathersName>
A2 Father
</FathersName>
<Address>A2 Address</Address>
<Occupation>Sales Professional</Occupation>
</Item>
and so on...
</Items>
xml2
Code:
<?xml version="1.0" encoding="utf-8"?>
<Items>
<Item>
<Date>
10/12/2010
</Date>
<Result1>0.1</Result1>
<Result2>0.4</Result2>
<Result3>0.5</Result3>
</Item>
<Item>
<Date>
10/17/2010
</Date>
<Result1>0.1</Result1>
<Result2>0.4</Result2>
<Result3>0.6</Result3>
</Item>
<Item>
<Date>
10/19/2010
</Date>
<Result1>
0.008
</Result1>
<Result2>
0.005
</Result2>
<Result3>
0.006
</Result3>
</Item>
and so on...
</Items>
Output
Code:
<table>
<theader>
<td>Date</td>
<td>Name</td>
<td>FathersName</td>
<td>Occupation</td>
<td>Result1</td>
<td>Result2</td>
<td>Adress</td>
<td>Result3</td>
</theader>
<tr>
<td>10/12/2010</td>
<td>A1</td>
<td>A</td>
<td>Engineer</td>
<td>0.1</td>
<td>0.4</td>
<td>xxx</td>
<td>0.5</td>
</tr>
<tr>
<td>10/15/2010
</td>
<td>A2</td>
<td>A2Father</td>
<td>SalesProfessional</td>
<td>-</td>
<td>-</td>
<td>A2 Address
</td>
<td>-</td>
</tr>
<tr>
<td>10/17/2010
</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>0.1</td>
<td>0.4</td>
<td>-</td>
<td>0.5</td>
</tr>
<tr>
<td>10/19/2010
</td>
<td>-</td>
<td>-</td>
<td>-</td>
<td>0.008</td>
<td>0.005</td>
<td>-</td>
<td>0.006</td>
</tr>
</table>
Thanks,