Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 87271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:22:36+00:00 2026-05-10T22:22:36+00:00

As the question says, it just escaped my memory how to display xml in

  • 0

As the question says, it just escaped my memory how to display xml in javascript, I want to display some source xml within an div on a page, that sits next to the processed result of the xml in another div.

Can’t remember if there was an equivalent to javascript’s escape to convert entities on the client

Note: the xml files are served as is from the server, so I need a client side solution

Note: the main problem is XML doesn’t render correctly in most browsers, all the brackets and attributes disappear, leaving you with text that doesn’t look like xml

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T22:22:36+00:00Added an answer on May 10, 2026 at 10:22 pm

    If you want the browser to render your XML as XML, it must be in it’s own document, like an iframe, or a frame. DIV won’t do the job!

    Besides, in the HTTP header of the request that serves the iframe you should send Content-Type: text/xml, so the Browser can understand that this content is an XML.

    But, if you truely need to see it in a DIV you will have to build yourself an XML rendering function XML2HTML. You can use the HTML PRE tag for that, if your XML string is already formatted (line breaks and tabs). In that case you will have to replace < to &gt; in the XML string.

    Conclusion: The browser can’t render XML and HTML in the same document. If you need it, you just have to workaround it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 76k
  • Answers 76k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer No it isn't possible. IFilters are mapped to a document… May 11, 2026 at 3:04 pm
  • added an answer Try the following var list = arrayList.Cast<int>().ToList(); This will only… May 11, 2026 at 3:04 pm
  • added an answer Short of overriding RenderContents on Menu, your options are very… May 11, 2026 at 3:04 pm

Related Questions

I'm still trying to get my head around using Java's generics. I have no
In VC++ 2003, I could just save the source file as UTF-8 and all
As the question says, I want to load a DLL from a location in
Here's one from the No question's too dumb department: Well, as the subject says:

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.