Problems with XSLT and Special Charachters

diekBlell

New Member
I have a very complex issue, I need some help with it.On my web app (ASP.net 4,C#) I use FOR XML PATH('') to convert Data from SQL Server to XML,and use the following lines to feed it to XSLT:\[code\]MemoryStream stream = new MemoryStream(UTF8Encoding.UTF8.GetBytes(xml));XPathDocument document = new XPathDocument(stream);StringWriter writer = new StringWriter();XslCompiledTransform transform = new XslCompiledTransform();transform.Load(xsltPath);transform.Transform(document, null, writer);return writer.ToString();\[/code\]Now when I feed messages from my forum, in sunny day scenarios, there should be no problem at all and there isn't.When a user decides to use special characters like < > in their messages thought, there we have the rainy day. I get an error which by the way differs from time to time (From message to message depending on what they write there).I have already tried disable-output-escaping="yes"Needless to say, I want the users to be able to use some tags like \[code\]<a href... or <font ...>\[/code\]Below is an example of one of the messages that causes the issue: \[code\]setting-->about phone----< software update\[/code\]Has anyone come across the same issue? Any possible solutions?
 
Back
Top