Can't highlight xml syntax with highlight.js

ahmagh

New Member
I'm trying to print xml on an html page.Exemple:\[code\]<pre><code class="xml"> <?xml version="1.0"?> <response value="http://stackoverflow.com/questions/10964115/ok" xml:lang="en"> <text>Ok</text> <comment html_allowed="true"/> <ns1:description><![CDATA[ CDATA is <not> magical. ]]></ns1:description> <a></a> <a/> </response></code></pre>\[/code\]I'd like to use highlight.js to highlight code on a page but there's a conflict with xml and html.I only had success with some php code using \[code\]<pre><code class="php"></code></pre>\[/code\], haven't tried with other languages. The only way I found to display xml code is in a textarea, but I'd prefer to show the xml with some sweet syntax-highlighting.I have made a jsfiddle to illustrate the problem.Hope you can help.
 
Back
Top