The following snippet demonstrates using .NET "ToShortDateString" inside XSL transform:-
Above defined method "ToCSharpShortDateString" can be used as follows:-
Now that xsl is ready, lets use this with ASP.NET xml control . Code behind should look something like this.
XmlDocument doc = new Document(xmlPath); XPathNavigator nav = doc.CreateNavigator(); xmlData.XPathNavigator = nav; string xslFileName = Server.MapPath("~/InvoiceReport.xsl"); xmlData.TransformSource = xslFileName; xmlData.DataBind();
Technological progress has merely provided us with more efficient means for going backwards. ~Aldous Huxley