C#
/// <summary> /// Xml, Xslt를 Transform 한 Data를 Return 한다. /// </summary> /// <param name="doc">Xml 문서</param> /// <param name="xsltPath">Xslt 절대경로</param> /// <returns>Transoform string Data</returns> #region // string XmlTranseform(XmlDocument doc, string xsltPath) // public string XmlTranseform(XmlDocument doc, string xsltPath) { XslCompiledTransform xtData = new XslCompiledTransform(); xtData.Load(xsltPath); StringWriter swData = new StringWriter(); xtData.Transform(doc, null, swData); return swData.ToString(); } #endregion /// <summary> /// Xml, Xslt를 Transform 한 Data를 Return 한다. /// </summary> /// <param name="strXml">Xml String Data</param> /// <param name="xsltPath">Xslt 절대경로</param> /// <returns>Transoform string Data</returns> #region // string XmlTranseform(string strXml, string xsltPath) // public string XmlTranseform(string strXml, string xsltPath) { XmlDocument doc = new XmlDocument(); doc.LoadXml(strXml); XslCompiledTransform xtData = new XslCompiledTransform(); xtData.Load(xsltPath); StringWriter swData = new StringWriter(); xtData.Transform(doc, null, swData); return swData.ToString(); } #endregion
'CSharp > Development' 카테고리의 다른 글
Reading dates from OpenXml Excel files (0) | 2011.05.12 |
---|---|
.NET Framework 버전 별 새로운 기능 (0) | 2011.03.23 |
Visual Studio 2010 and .NET Framework 4 Training Kit (2) | 2011.01.19 |
FileInfo를 이용한 FileStream, StreamWrite, StreamReader 이용 (0) | 2010.01.15 |
Visual Studio 2005 .NET Framework Source 확인 (0) | 2009.12.18 |