How to process more that one XML document in XSLT?
- by brain_pusher
Is there any trick to match two XML by one XSLT? I mean the way I can apply XSLT to a parameter passed.
For example (I missed declarations to be short). XML1: XML to be transformed:
<myData>
<Collection>
</Collection>
</myData>
XSLT need to be applied to the previous XML:
<xsl:param name='items' />
<xsl:template match='Collection'>
<!-- some transformation here -->
</xsl:template>
XML2: XML data passed as the parameter 'items':
<newData>
<Item>1</Item>
<Item>2</Item>
<Item>3</Item>
</newData>
And I need to create a set of nodes in the 'Collection' node in XML1 for each 'Item' element in XML2 using XSLT. And I do not know what XML2 contains exactly at design time. It is generated at runtime, so I can't place it inside XSLT, I know only its schema.