So, I am working with .NET. I have an XSL file, XslTransform object in C# that reads in the XSL file and transforms a piece of XML data (manufactured in-house) into HTML.
I notice that my final output has < and > automatically encoded into < and >. Is there any ways I can prevent that from happening? Sometimes I need to bold or italicize my text but it’s been unintentionally sanitized.
Your xsl file should have:
i.e.
And you should ideally use the overloads that accept either a
TextWriteror aStream(notXmlWriter) – i.e. something like:In the xslt, if you really want standalone
</>(i.e. you want it to be malformed for some reason), then you need to disable output escaping:However, in general it is correct to escape the characters.