 |
 |
 |
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? I am using C#.
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..
|
 | 



|  |
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.
|  |
| |
 |
 |
 |