Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Xml transform to Another Xml

From: Martin Honnen <mahotrash@-----.-->
To: 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/


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent