• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

XSLT and Servlets

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am generating an xml file from a servlet. That works.
I want to use a XSLT style sheet with the dynamic xml file.
Is that possible?
If I use the style sheet with a static xml file it works fine.
When I generate the xml file dynamically from a servlet (Tomcat)
I get an error message:

Is this what doesn't work dynamically?
Thanks very much ... Marv
 
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
It works perfectly and Please check the link
http://www.onjava.com/pub/a/onjava/2000/12/15/xslt_servlets.html?page=1
XALAN is required for the XSLT processing. You can get it from the Apache open source project.
ATB,
Gaya3
----------------------------------------------------------------------------
Learning By Doing-is Healthy
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can also look into this example, its same like above
As mentioned in the above example, you have explicitly specify where the xml file and xsl files were located to the transformer class(see example), it not enough if you just specify <?xml-stylesheet type="text/xsl" href="EssOutline.xsl"?> in the dynamically generated xml file.
Also see the XALAN API on how to give the string(i assume u generate xml as string) to the transformer object as an input.
 
Marvin Monk
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks very much for the help!
I will give XALAN a try...
Marv
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic