16

I am trying to ask a question which contains sample XML code but I can't paste sample XML code in the question. How it can be done?

18

Note that if your XML doesn't get recognized despite the code block, you can add

<!-- language: lang-xml -->

before the code block. This has been elaborated in this page and further in here.

Feature was added in 2011 so I realize it was not available at the time the question and the other answers were placed.

| improve this answer | |
6

You need to paste your XML, and then highlight the lines in question, and press on the "code" button ({ } on the editor toolbar).

The code button

This will nicely format and syntax highlight your code and/or XML.

| improve this answer | |
3

XML is still a language so use the regular code button (its the icon with binary on it) otherwise use http://pastebin.com to post the code and then past the link here.

Not that hard

| improve this answer | |
  • 4
    Please post sample XML in the question; not on a separate site. – ben is uǝq backwards Apr 17 '13 at 10:05