I'm trying to merge two tables using XSLT 1.0.
I have a representation of two DB tables in XML. The first table is a set of key-value pairs:
Table1.xml
<table>
<row>
<column name="key">key1</column>
<column name="value">val1</column>
</row>
<row>
<column name="key">key2</column>
<column name="value">val2</column>
</row>
</table>
The second table has rows of data:
Table2.xml
<table>
<row>
<column name="A">a1</column>
<column name="B">b1</column>
<column name="C">c1</column>
</row>
<row>
<column name="A">a2</column>
<column name="B">b2</column>
<column name="C">c2</column>
</row>
</table>
I am trying to take one of the key-value pairs and add insert it as a new column in every row so that it ends up with this:
Output.xml
<table>
<row>
<column name="A">a1</column>
<column name="B">b1</column>
<column name="C">c1</column>
<column name="key1">val1</column>
</row>
<row>
<column name="A">a2</column>
<column name="B">b2</column>
<column name="C">c2</column>
<column name="key1">val1</column>
</row>
</table>