Apply Xslt on in-memory Xml and returning in-memory Xml

Posted by Jan Willem B on Stack Overflow See other posts from Stack Overflow or by Jan Willem B
Published on 2010-05-18T09:33:41Z Indexed on 2010/05/18 9:40 UTC
Read the original article Hit count: 154

Filed under:
|
|

I am looking for a static function in the .NET framework which takes an XML snippet and an Xslt file, applies the transformation in memory, and returns the transformed XML.

I would like to do this:

string rawXml = invoiceTemplateDoc.MainDocumentPart.Document.InnerXml;
rawXml = DoXsltTransformation(rawXml, @"c:\prepare-invoice.xslt"));

// ... do more manipulations on the rawXml

Alternatively, instead of taking and returning strings, it could be taking and returning XmlNodes.

Is there such a function?

© Stack Overflow or respective owner

Related posts about c#

Related posts about xslt