Connecting Tech Pros Worldwide Forums | Help | Site Map

Re: Merge 2 XML into one

fj
Guest
 
Posts: n/a
#1: Sep 16 '08
Thanks Martin.
I am still get stuck in one thing... I am using the xslt in my code. So
these two source xml documents will be represented as variables in my code,
such as XmlDocument in .net.

How can I pull in the second xml into the xslt template?

-fj



Martin Honnen
Guest
 
Posts: n/a
#2: Sep 17 '08

re: Re: Merge 2 XML into one


fj wrote:
Quote:
I am still get stuck in one thing... I am using the xslt in my code. So
these two source xml documents will be represented as variables in my code,
such as XmlDocument in .net.
>
How can I pull in the second xml into the xslt template?
Use an XsltArgumentList and call
XsltArgumentList xsltArgs = new XsltArgumentList();
xsltArgs.AddParam("paramName", "", yourXmlDocument)
on it, the pass that XsltArgumentList to the Transform method (as the
second argument usually).
In your stylesheet you need
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:param name="paramName"/>

<xsl:variable name="products"
select="$paramName/Products/Product"/>


--

Martin Honnen
http://JavaScript.FAQTs.com/
Closed Thread