[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: How to save output of XSLT to file
Hi Thadthong, Following is an example I used on ASP.NET 1.x, with the XML Web server control which is capable o doing transformations XSLT 1.0. First, an xml source is loaded into an XmlDocument using a SQL Query Template, which executes a SQL query and returns the data in xml format. Then, the snippet that starts with XmlTextWriter shows how to persist the output to disk in ASP.NET. Finally, the XML Web Server contol is used to perform the transformation and show the output on the screen. string strUrlXmlTemplateArticle = "http://" + System.Configuration.ConfigurationSettings.AppSettings["strLocalHost"] + "/docnet2/templates/tmpl.xml"; XmlDocument doc = new XmlDocument(); doc.Load(strUrlXmlTemplateArticle); XmlTextWriter writer = new XmlTextWriter(Server.MapPath("/docnet/xml/tmpl.xml"), System.Text.Encoding.UTF8); writer.Formatting = Formatting.Indented; writer.Indentation = 2; doc.Save(writer); writer.Close(); XmlOD.Document = doc; XmlOD.Transform = (XslTransform)Cache["aplXslTransform"]; HTH, <prs/> -----Original Message----- From: Thadthong Bhrammanee [mailto:st018570@xxxxxxxxx] Sent: Wednesday, January 26, 2005 6:58 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: How to save output of XSLT to file Hi, I'm using asp.net (let's say "tran.aspx") for displaying the transformation outputs (one in text and one in html, according to <xsl:output method="..">). Please advice the way I can save those transformation outputs to new files (e.g., saved.txt). I appreciate your advice. J. ---------------------------------------------------------- This mail sent through AIT WebMail : http://www.ait.ac.th/
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|