______________C# sample________________
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
using System; using System.Collections.Generic; using System.Xml; using System.Xml.Xsl; using System.Xml.XPath; using System.IO; - 중간 생략 - public XmlElement ...... { XmlDocument docXml = new XmlDocument(); XslCompiledTransform xslt = new XslCompiledTransform(); StringWriter stringWriter = new StringWriter(); docXml = new XmlDocument(); docXml.PreserveWhitespace = false; docXml.LoadXml(resultXML); xslt.Load(Server.MapPath("XSLTDefault.xslt")); xslt.Transform(docXml, null, stringWriter); docXml.LoadXml(stringWriter.ToString()); return docXml.DocumentElement; } |