Possible Duplicate:
Producing a new line in XSLT
if have the following xslt file:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:output method="text" />
<xsl:template match="//teilnehmer">
<xsl:value-of select="name"/>
<xsl:value-of select="kind"/>
</xsl:template>
</xsl:stylesheet>
the output after transformation is a string without any whitespaces or line breaks
how can I add some formatting (e.g. a line break after a name)?
thanks in advance!
The easiest way is with
<xsl:text>
</xsl:text>

 being a character reference that represents the newline character. Alternatively you can do
<xsl:text>
</xsl:text>
(i.e. an <xsl:text> containing just a newline character) but you need to ensure there are no spaces between the newline and the closing </xsl:text> (as they would be included in the output), which is easy to mess up if you ever use an IDE that does automatic indentation. Using the character reference is more robust.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With