Been trying for hours getting this to work but I must be missing something.
I want to map two XML documents together by an id in both documents.
I can get data output from both documents using one XSLT but I don’t know how to map them.
first xml:
...
<member>
<id>1</id>
<name>John</name>
</member>
<member>
<id>2</id>
<name>Otto</name>
</member>
...
second xml: (ss namespace)
...
<row>
<cell ss:Type="String">id</cell>
<cell ss:Type="String">Number 1</cell>
<cell ss:Type="String">Number 2</cell>
</row>
<row>
<cell ss:Type="Number">1</cell>
<cell ss:Type="Number">1231312313</cell>
<cell ss:Type="Number">234234234342</cell>
</row>
<row>
<cell ss:Type="Number">2</cell>
<cell ss:Type="Number">4353453453</cell>
<cell ss:Type="Number">345345345455</cell>
</row>
...
I loop through name and id elements in the XSLT file and inside this loop I’m trying to get the value to map to the id in the second xml using apply templates.
The final HTML output should look something like:
Id Name Number 1 Number 2
1 John 1231312313 234234234342
2 Otto 4353453453 345345345455
I solved it with call-template “function” and passed the value for id as parameter. Then pick up the “Number” tags values in the second file with a for-each and a if-statement. It works.