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
Win a copy of
TDD for a Shopping Website LiveProject
this week in the
Testing
forum!
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
Forum:
XML and Related Technologies
XSL transformation to String
Ben Klug
Ranch Hand
Posts: 45
posted 17 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 17 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
]
Do the next thing next. That’s a pretty good rule. Read the tiny ad, that’s a pretty good rule, too.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
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...