using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;
public virtual Stream Transform(Stream payload)
{
XPathDocument myXPathDoc = new
XPathDocument(payload);
XslCompiledTransform myXslTrans = new XslCompiledTransform();
myXslTrans.Load(this.XsltPath); //Path to XSLT used for transform
Stream formattedRequest = new MemoryStream();
XmlTextWriter myWriter = new
XmlTextWriter(formattedRequest, null);
myXslTrans.Transform(myXPathDoc, null, myWriter);
formattedRequest.Seek(0, SeekOrigin.Begin);
payload.Close();
return formattedRequest;
}
No comments:
Post a Comment