Developer2009. 1. 13. 16:04
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

'Developer' 카테고리의 다른 글

Create Table  (0) 2009.01.28
HTML Mailto Protocol  (0) 2009.01.21
Xml Xslt Transform with C#  (0) 2009.01.13
Xml Xslt Transform with Javascript  (0) 2009.01.13
Javascript XmlDocument handler  (0) 2009.01.07
showModalDialog, showModelessDialog 사용방법  (0) 2009.01.02

Posted by Angeleyes

Ask me를 이용하시면 댓글보다 빨리 답변 드릴 수 있습니다.

댓글을 달아 주세요