In the HTML file, I need to show some XML code. The problem is that I can't use
<pre>..</pre>
to show '<' and '>'.
What would be the solution for this problem?
From the answer, replacing '<' and '>' to < and> can be a solution. I'm an Emacs user, are there Emacs tools/magic to do that automatically? I mean, I can use search and replace, but I expect Emacs can do it by 'select region' -> 'M-x replace_xml' or something.
You need to escape < as < and & as &. Optionally, for consistency, you can escape > as >
To do this automatically in Emacs, if you're in HTML mode, you can select the code that you would like to escape, and run M-x sgml-quote.
You need to replace < by < and > by >. How to do this depends on the server side language in question.
Update: as per your update: this is not programming related anymore. I think http://superuser.com is a better place to ask software related questions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With