If you look at the source, you will notice that you are extracting XML twice, since @ already encodes the text, and @Html.Encode(..) does it again. Therefore, you do not get the correct conclusion that SyntaxHighlighter is undestand as code.
Just try this example and everything will work fine:
<!DOCTYPE html> <html> <head> <link href="http://alexgorbatchev.com/pub/sh/current/styles/shCore.css" rel="stylesheet" type="text/css" /> <link href="http://alexgorbatchev.com/pub/sh/current/styles/shThemeDefault.css" rel="stylesheet" type="text/css" /> </head> <body> @{ var xml = @" <?xml version='1.0'?> <response value='ok' xml:lang='en'> <text>Ok</text> <comment html_allowed='true'/> <ns1:description> descriptin. </ns1:description> <a></a> <a/> </response>"; } <pre class="brush: xml"> @xml </pre> <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shCore.js" type="text/javascript"></script> <script src="http://alexgorbatchev.com/pub/sh/current/scripts/shAutoloader.js" type="text/javascript"></script> <script type="text/javascript"> SyntaxHighlighter.autoloader( 'xml xhtml xslt html http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js' ); SyntaxHighlighter.all(); </script> </body> </html>
source share