Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connecting to xml from servlet

 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey,there in the outerspace;
is there a simple way to connect to a xml file from a servlet.
i have a servlet, that creates a xml file and i want to display this xml file in a browser from this servlet.
sounds complicated?
ok, the basic question is:
i have a servlet and a xmlfile(with a xslfile) and i want the servlet to call the xml file, just like a browser call a html file to display.
any idea?
bernd :roll:
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bernd
I assume you're wanting to transform the xml into HTML so it can be displayed neatly in the browser? If that is the case then you're going to want to look into filter and using your xsl template to transform the xml into formatted HTML.
Sun has a tutorial on them that actually has an example of using an xsl template to transform an xml document into html. The example they give is fairly complex and can probably be done much simpler if your document is not very complicated.
 
bernd pier
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey dave,
thanx for your help.
it seems, that i was a little bit on the edge, cause yesterday, after sleeping about it,i saw, that i only had to parse the xml file and that`s it i think.
first i had the idea, that there could be something like href in html.
ciao
Bernd
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic