![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Xml transform to Another Xml >Thread Next - Re: Xml transform to Another Xml Re: Xml transform to Another XmlTo: NULL Date: 8/22/2007 4:04:00 PM
Rasheed wrote:
> i.e I have to send some input parameters to the xslt file through c#
> code(by XsltArgumentList.AddParam()).
> i have send the input parameter to xml are like "currency information"
> or "amount information" etc ....(You can see in Below Xml as attribute
> information).
> For that how I have to change the my xslt to recieve the input
> parameters from the C# code ?
You need to define top level parameters e.g.
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:param name"currency" select="'EUR'"/>
<!-- defines the parameter named currency with default value 'EUR' -->
<!-- you can use that parameter as $currency in XPath expressions -->
...
</xsl:stylesheet>
then you can set that paramter using XsltArgumentList before you run a
transformation:
XsltArgumentList arguments = new XsltArgumentList();
arguments.AddParam("currency", "", "USD");
> and i am unable to see the <author ....>node with attribut values so
> can you please change your xslt in such a way that it will copy/
> xsl:apply-templates the <author ....> node attribute values as
> well.
<xsl:template match="author">
<xsl:copy>
<xsl:apply-templates select="@* | name"/>
<type>criminal</type>
<description>...</description>
<Authorinfo>
<xsl:apply-templates select="address | phone | city"/>
</Authorinfo>
</xsl:copy>
</xsl:template>
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
