Let's say I have two strings:
- one is XML data
- and the other is XSL data.
The xml and xsl data are stored in database columns, if you must know.
How can I transform the XML in C# w/o saving the xml and xsl as files first? I would like the output to be a string, too (HTML from the transformation).
It seems C# prefers to transform via files. I couldn't find a string-input overload for Load() in XslCompiledTransform. So, that's why I'm asking.
It took me a long time (literally years) to work out how concise code using
Stream
and/orTextWriter
can be if you use the proper idioms.Assuming
transform
andinput
are strings: