|
Simple Transform More code coming soon - this is just a place holder but it should work using System.Xml;using System.Xml.XPath; using System.Xml.Xsl; private static string transXMLStringThroughXSLTFile(string sXML, string sXSLTFile) { //This is the logic of the application. XslTransform objTransform=new XslTransform(); XmlDocument objDocument=new XmlDocument(); StringWriter objStream=new StringWriter(); //objDocument.Load(strAppPath+"BookFair.xml"); objDocument.LoadXml(sXML); objTransform.Load(sXSLTFile); objTransform.Transform(objDocument,null, objStream,null); return objStream.ToString().Replace(@"encoding=""utf-16""?>",@"encoding=""utf-8""?>"); } private static string transXMLStringThroughXSLTString(string sXML, string sXSLT) { XslTransform objTransform=new XslTransform(); XmlDocument objDocument=new XmlDocument(); StringWriter objStream=new StringWriter(); objDocument.LoadXml(sXML); StringReader stream = new StringReader(sXSLT); XmlReader xmlR = new XmlTextReader(stream); objTransform.Load(xmlR,null,null); objTransform.Transform(objDocument,null, objStream,null); return objStream.ToString().Replace(@"encoding=""utf-16""?>",@"encoding=""utf-8""?>"); } back to code page by wiseleyb@yahoo.com Last Modified 5/10/04 3:33 PM | Hide Tools |