WSK
WSK

Reputation: 6138

XML based template engine in Java?

Can somebody suggest me a template engine (preferably written in Java) that could generate any text that I like from given XML input?

Upvotes: 3

Views: 1511

Answers (3)

Justin Rowe
Justin Rowe

Reputation: 2446

You can use XSLT, it is not restricted to generating only XML output. It is restricted to XML input. Use the xsl:output tag do define the type of output you will be generating.

E.g. to generate text output

<xsl:output method="text" encoding="UTF-8"/>

To generate XML output with indentation

<xsl:output method="xml" encoding="UTF-8" indent="yes"/>

Upvotes: 1

adarshr
adarshr

Reputation: 62573

How about XSLt? You may use JAXP to do the processing.

Upvotes: 2

kadalamittai
kadalamittai

Reputation: 2166

StringTemplate, FreeMarker

Upvotes: 3

Related Questions