Wednesday, 25 February 2015

How can a C# XSLT extension function return an XML fragment that gets used as unescaped XML?



I've written an XSLT which uses a C# extension function. That function returns an XML fragment. Something like this:



public string MyFunc(string input)
{
return "<thisIsXml/>";
}


I call it like this:



<value-of select="extensions:MyFunc(.)"/>


It works, but the response is escaped, so it ends up in the result like this:



&lt;thisIsXml&gt;


I don't want that -- I want this injected as actual, unescaped XML. Possible?


(This is C#, so XSLT 1.0 only.)


No comments:

Post a Comment