Search code examples
jqueryhtmlxmltwitter-bootstrappopover

How to display formatted xml text in a bootstrap popover


I have some data formatted in xml way and I need to display it in a popover's content. The xml tags are interpreted as html tags...

<Document><and><age>50</age><always/></and></document>

I want to display xml as simple text and to be indented. Is there a way to do that?

So result should be:

    <Document>
       <and>
           <age>50</age>
           <always/>
      </and>
   </document>

Thank a lot.


Solution

  • Use the pre tag for this in the following way: <pre lang="xml"><your xml here></pre> Also set the html option to true in the options of the popover.