Subject:How to insert line breaks/blanks into a resulting XML doc? Author:Matt Adams Date:02 Oct 2004 01:12 PM
When I apply a XSLT stylesheet to a XML document a number of
text lines, tags and values are written to a file/console.
I know that line breaks (control returns under WinXP)
are not relevant/essential for XML document.
But for source viewing of the XML document I would like
to insert occasionally a ControlReturn.
How can I achieve that after a certain output a (physical) line break
is inserted too? E.g that after the true or false result in
<xsl:value-of select="exists(....)" />
a new line starts?
Moreover how could I prepend the boolean result by exactly
5 blanks?
Subject:How to insert line breaks/blanks into a resulting XML doc? Author:Tony Lavinio Date:04 Oct 2004 01:51 AM
Use <xsl:text></xsl:text> to contain literal white space;
you can even do something clever like <xsl:text>
</xsl:text> to send just a newline, or <xsl:text> </xsl:text>
to send five blanks.
And if you use <xsl:if test=...>, you can send your literal
output based on an arbitrary condition.