XSLT newbie question: Please fill in the blank in the C# code fragment below:
public static string TransformXMLToHTML(string inputXml, string xsltString) {
// insert code here to apply the transform specified by xsltString to inputXml
// and return the resultant HTML string.
// You may assume that the xslt output type is HTML.
}
Thanks!
Just for fun, a slightly less elegant version that implements the caching suggested by Marc:
How about:
Note that ideally you would cache and re-use the
XslCompiledTransform
- or perhaps useXslTransform
instead (it is marked as deprecated, though).