What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 129 Stack Exchange communities.

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 stackoverflow.com Dec 12 '10 at 22:47

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

1  
This belongs over on Meta Stack Overflow. (Short answer: indent each line with four spaces.) –  Antal S-Z Dec 12 '10 at 22:47
1  
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

2 Answers 2

Use code formatting (four leading spaces)

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

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:

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

You must log in to answer this question.

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