0

What I'm trying to figure out is how to display XML snippets on a webpage using HTML. However the things I've tried have resulted in my XML tags to disappear but the text remains.

<pre> <code class="codeblock"><![CDATA[
   <dependency>
     <groupId>com.foo.bar</groupId>
     <artifactId>bar</artifactId>
     <version>LATEST</version>
   </dependency>
]]></code></pre>

The above results in the below to be displayed

com.foo.bar
bar
LATEST

the desired output would be

<dependency>
  <groupId>com.foo.bar</groupId>
  <artifactId>bar</artifactId>
  <version>LATEST</version>
</dependency>
1
  • @MelanciaUK thanks seemed to have missed that when searching Commented Apr 28, 2015 at 15:11

1 Answer 1

2

Something like this:

<pre>&lt;dependency&gt;
  &lt;groupId&gt;com.foo.bar&lt;/groupId&gt;
  &lt;artifactId&gt;bar&lt;/artifactId&gt;
  &lt;version&gt;LATEST&lt;/version&gt;
&lt;/dependency&gt;</pre>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.