Is there any trick to match two XML by one XSLT?

Posted by brain_pusher on Stack Overflow See other posts from Stack Overflow or by brain_pusher
Published on 2010-05-12T10:21:11Z Indexed on 2010/05/12 10:24 UTC
Read the original article Hit count: 140

Filed under:
|

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.

© Stack Overflow or respective owner

Related posts about xslt

Related posts about Xml