This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XML to text rendering Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML to text rendering" Watch "XML to text rendering" New topic

XML to text rendering

Anand Jayaraman
Ranch Hand

Joined: Jan 28, 2004
Posts: 104
Hi Guys!!

I have an XML file and I'd like to convert it to a text output with XSLT.

Consider the following:

<subject> Re: XSLT Help!! </subject>
<body>Can you guys help me out???</body>

I'd like to have this in the following format in text!

Re: XSLT Help!!

Can you guys help me out???


My limited knowledge of XSLT can only output the data in a single line.

Can someone advice as to how I'd be solving the problem???
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Use the <xsl:text> element to output a newline character when appropriate.

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
I agree. Here's the link:
subject: XML to text rendering
Similar Threads
XML to Text with XSLT
Group By Question
xsl:include replaces previous defined xsl:template?
use tiles to configure a "deep" layout
HELP with tiles