You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Da...@lotus.com on 2000/08/28 16:37:06 UTC

Tab-delimited text output (Was: Newbie problems)

Michael Veeck asks:
>1) I want to create a text file with Comma-Seperated-Values in it.
>Well, actually the values should be seperated by the tabulator "\t".
>How should I approach that best ?

I'd suggest that all literal text output be done within xsl:text
elements. Inside your template, have a sequence of <xsl:text> and
<xsl:value-of> elements as needed. Xalan can then assume that any
white space inside xsl:template but between the above elements is
just for stylesheet readability and not for output.

Also, keep in mind that displaying the output may be inconsistent,
because different output tools may interpret the TABs differently.
I gather that you want tabs for further machine processing of the
file, so they serve as field separators as commas would in the CSV
format. If that's true, then your remark about "way too much space"
is a secondary concern to ensuring that fields are properly
separated. I also assume that text fields (name?) will never have
TABs in their values.
................David Marston