Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I'm trying to ask a question about XML and would like to include a sample document so that my question is clear. Before I can ask my question, I need to figure out how to type xml in here and and have it displayed. I've tried every combination of pre, blink, quotes slashes... and looked through the formatting help but haven't had any luck. How can I display my XML in a stackoverflow question?

share|improve this question

migrated from Dec 12 '10 at 22:47

This question came from our site for professional and enthusiast programmers.

This belongs over on Meta Stack Overflow. (Short answer: indent each line with four spaces.) – Antal Spector-Zabusky Dec 12 '10 at 22:47
I'm sorry, this isn't making sense to me. I'll start with trying to get "<document>" to show up in a pre block. I've put 4 spaces everywhere I can think of, with no success... – ajwood Dec 13 '10 at 0:57
up vote 3 down vote accepted

See at the top of the editing help (highlight by me):

Code and Preformatted Text

Indent four spaces to create an escaped <pre><code> block:

printf("goodbye world!");  /* his suicide note
                              was in C */

The text will be wrapped in tags, and displayed in a monospaced font. The first four spaces will be stripped off, but all other whitespace will be preserved.

Markdown and HTML is ignored within a code block:

   You would hate this if it weren't
   wrapped in a code block.
share|improve this answer

Use code formatting (four leading spaces)

  <type="xml">is xml</type>
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .