![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries [Thread Prev] >Thread Next - Re: passing parameter values to an xslt passing parameter values to an xsltTo: NULL Date: 7/18/2007 2:19:00 AM hi guys I have this xml which I create on runtime and I use an XSLT to display it on a web page. Now I want to define a parameter with in the XSLT, I am able to create the parameter but how do I pass the value to the XSLT to read? Here is an example of my code.. string strXSLTFileName = "Report.xslt"; XmlDocument xmlDoc = new XmlDocument (); xmlDoc.LoadXml ('myxmlstring'); // my xml is created on runtime System.Xml.Xsl.XslTransform trans = new System.Xml.Xsl.XslTransform (); System.Xml.Xsl.XsltArgumentList xslArg = new System.Xml.Xsl.XsltArgumentList (); xslArg.AddParam ("isTotal", "", bIsTotal.ToString()); trans.Load (strXSLTFileName); trans.Transform (xmlDoc, xslArg); xmlData.Transform = trans; // from the .aspx page and in my .aspx page I have this <asp:Xml ID="xmlData" runat="server" /> and in my xslt file I have this <xsl:param name="isTotal"></xsl:param> <xsl:template match="/"> <p> <h2>The value of the param is <xsl:value-of select="$isTotal"/></h2> </p> The xml is just thrown away after rendering the webpage so.. I am totally lost. Can anyone help me? Thanx a million.. | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
