Friday, May 15, 2009

XSL transform from string to string

Example code to do XSL transform from string to string

XPathDocument doc = new XPathDocument(new StringReader(inputXML));
XslTransform xslt = new XslTransform();
xslt.Load(whatever);
StringWriter sw = new StringWriter();
xslt.Transform(doc, null, sw);

The resulting string is in sw.ToString().

No comments:

Post a Comment