• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

XML to String

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am working in Websphere commerce environment. I am creating a DOM document which is an xml. I am doing this in a jsp. So when I access this jsp, the created xml should be printed on the page. Now I created the xml and stored it in a separate file. I would like to print that xml in a browser when that particular view is requested. Can you pls help me out on how can I print that out in the browser when that particular jsp (view) is requested?

Thank you.

I need to finish this task bfr tomorrow. So can someone pls help me out with this one?
 
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want the XML AS-IS, the easiest is put it in an editbox, and make it scrollable and read only. In this way, your browser would not do anything about it.
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the xml is in a string reference, just use the JSP's writer out to print it on the jsp.


 
Roseanne Zhang
Ranch Hand
Posts: 1953
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, Srivatsa Katta

I don't think your way will work, all xml tags will be gone by browser's decision. The page seen by client will be a total mess.

Try it!
 
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Roseanne Zhang:
Sorry, Srivatsa Katta
I don't think your way will work,



I think all browsers know as how to deal with XML and present the user a tree like structure of the xml.
[ June 29, 2007: Message edited by: Rahul Bhattacharjee ]
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rahul Bhattacharjee:


I think all browsers know as how to deal with XML and present the user a tree like structure of the xml.

[ June 29, 2007: Message edited by: Rahul Bhattacharjee ]



It may be helpful to send the correct Content-Type header for this.
 
That which doesn't kill us makes us stronger. I think a piece of pie wouldn't kill me. Tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic