"{appRootUrl}"
Helper.ApplicationRootUrl
public static string TransformXml(string inputXml, string xslVirtualFile) { //- Load XSL Transformation ----------------------------------------------------------- xslVirtualFile = HttpContext.Current.Server.MapPath(xslVirtualFile); XslCompiledTransform xslTransform = new XslCompiledTransform(); xslTransform.Load(xslVirtualFile); StreamReader streamReader = new StreamReader(xslVirtualFile); string xsl = streamReader.ReadToEnd(); streamReader.Close(); xsl = xsl.Replace("{appRootUrl}", Helper.ApplicationRootUrl); MemoryStream ms = new MemoryStream(System.Text.ASCIIEncoding.ASCII.GetBytes(xsl)); xslTransform.Load(new XmlTextReader(ms)); //- Load XML Data --------------------------------------------------------------------- StringReader sr = new StringReader(inputXml); XmlReader xr = new XmlTextReader(sr); StringWriter sw = new StringWriter(); XmlWriter xw = new XmlTextWriter(sw); //- Transform and Output Data --------------------------------------------------------- xslTransform.Transform(xr, xw); return sw.ToString(); }
ScrewTurn Wiki version 3.0.1.400. Some of the icons created by FamFamFam. Except where noted, all contents Copyright © 1999-2024, Patrick Jasinski.