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 766425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:02:47+00:00 2026-05-14T17:02:47+00:00

I want to display an exception trace in the HTML page. One way to

  • 0

I want to display an exception trace in the HTML page.

One way to do this is to escape HTML special characters in the exception trace and dump it inside the <pre> tag.

Although it works, it’s terribly inefficient. I thought that one approach would be to wrap the trace with CDATA. I’ve tried it, but nothing get’s displayed.

My question, can this be done?

Here is my feeble attempt.

  <pre><![CDATA[blah, blah, blah with <>
  and blah blah blah with &
    and more blah, blah]]></pre>
  • 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. Editorial Team
    Editorial Team
    2026-05-14T17:02:48+00:00Added an answer on May 14, 2026 at 5:02 pm

    It would only work if you’re serving the page as XML (application/xhtml+xml); there are no CDATA sections in plain HTML. Most browsers in HTML mode would just ignore the example CDATA section.

    And throwing <![CDATA[…]]> around a string is not sufficient to wrap it, anyway. If your trace information had the sequence ]]> in it, that’d end the CDATA section and you’d be back at the same problem. So you have to do at least one escape to cope with that case, and if you’re going to be doing an escaping process anyway you might as well do a proper HTML-escape.

    This is why CDATA sections are largely pointless. A lot of people seem to think it somehow absolves them of thinking about escaping issues, but it really doesn’t.

    Anyway, HTML-escaping isn’t inefficient. It’s a couple of string replaces. Any web app(*) will be doing a hundred HTML-escapes every page. Adding one more — especially for a debugging case where efficiency doesn’t matter at all! — is no great burden.

    (*: well, except for poorly-written apps from PHP tutorials, whose authors have never even heard of htmlspecialchars, obviously.)

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

Sidebar

Related Questions

I have db with this table (TableToDo): http://goo.gl/NlTEk I want display all records in
In the header of the django admin, I want display a link. This link
I want to display images in a TableView . I can display one image
I want to display result of this javascript in a label control on my
I want to display visual/auditory stimuli inside a web browser for psychophysic experiments. I
My main issue is that I want to display an custom error page when
So i got this treeview where i want to display some people with as
I have 52 images that is coming from web URL.I want to display this
I want to display image in TextView with text, I had used Html.ImageGetter but
I want redirect to error page when exception occured. If the code is not

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.