Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within XML
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
XML and Related Technologies
XSL transformation to String
Ben Klug
Ranch Hand
Posts: 45
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi what ist the best way, to get a
String
out of a XLST-Tranfomation instead ouf a Output-Stream:
TransformerFactory tFactory = TransformerFactory.newInstance(); transformer transformer = tFactory.newTransformer(new StreamSource(xslFile)); transformer.transform(new StreamSource(xmlFile), ...);
any ideas??
thanks
[ October 13, 2004: Message edited by: Ben Klug ]
Lasse Koskela
author
Posts: 11962
5
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Just wrap the StreamSource around a sink you can extract the output as a String. Our
FAQ
has a code snippet that's almost made for you.
Author of
Test Driven
(2007) and
Effective Unit Testing
(2013) [
Blog
] [
HowToAskQuestionsOnJavaRanch
]
Consider Paul's
rocket mass heater
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Transformation Problem For Arabic/French Character : HTML to XML
XML Transformation error
parsing and displaying xml data - options?
Transformation works at the command line but fails in my web application.
No output from Servlet
More...