NeargeNapcorb
New Member
I have converted several xml with stylesheet using \[code\]XslCompiledTransform\[/code\].But now i struck with a particular one.I have googled and use stack overflow suggestions. But helpless.Am in need of this very urgent.My xml and stylesheet file is very large and i can't paste the sample here.Here is link for CCR xml and its corresponding style sheet.Please refer it and help meI have tried the following code\[code\]var xml = new XmlDocument();xml.LoadXml(content); // xml inputvar xsl = new XmlDocument();xsl.LoadXml(styleSheetContent); // here i loaded the style sheet file contentsXslCompiledTransform myXslTransform = new XslCompiledTransform();XmlUrlResolver resolver = new XmlUrlResolver();resolver.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials; myXslTransform.Load(xsl, XsltSettings.TrustedXslt, resolver);StringWriter stm = new StringWriter();myXslTransform.Transform(xml, null, stm);System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;response.Write(stm.ToString());response.End();\[/code\]Also tried appending reference to xml file using this\[code\] XElement elem = XElement.Parse(content); XmlDocument doc = new XmlDocument(); doc.LoadXml(elem.ToString()); XmlProcessingInstruction newPI; string PItext = "type='text/xsl' href='" + ConfigurationManager.AppSettings["XslUrl"].ToString() + xslUrl + "'"; newPI = doc.CreateProcessingInstruction("xml-stylesheet", PItext); doc.AppendChild(newPI);\[/code\]style sheet file is appending at the bottom of xml but of no use.