xml on browser with its tags

Posted on 2004-11-08
Last Modified: 2013-11-19
i have table in db which stores the data in xml format
shown below for particular user id..


and i am trying to display whole xml segment including its tag
for each user id on browser with "JSP". but browser only displays data
not the whole xml segment for each individual user id..
so output should be like this


can we do that without using xslt???
Question by:ghatlodia
    LVL 35

    Accepted Solution

    you need to replace the "<" with "&lt;" and the ">" with "&gt;"

    Then the browser will render it ok :-)


    <%= xml.replaceAll( "<", "&lt;" ).replaceAll( ">", "&gt;" ) %>

    that may work (but it probably need some escape chars in it ;-) )
    LVL 35

    Expert Comment

    just tested fine :-)
    LVL 1

    Author Comment

    thanks  TimYates   now it is working fine..

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Prepare to Pass the CompTIA A+ 900 Series Exam

    CompTIA aims to adapt its A+ Certification to reflect the most current knowledge and skills needed by today's IT professionals--and this year's 2016 exam is harder than ever. This certification is one of the most highly-respected and sought after in IT.

    There are two main kinds of selectors in CSS: One is base selector like h1, h2, body, table or any existing HTML tags.  For instance, the following rule sets all paragraphs (<p> elements) to red: (CODE) CSS also allows us to define our own custom …
    Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    934 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now