File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes white space problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "white space problem" Watch "white space problem" New topic

white space problem

felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89

I have a problem while my data which is shown in csv format on the browser when it is saved in text format.

The functionality data is shown on the browser in csv format which
comes properly. but there is a Save button the page ,when i do save i use a javascript method to call the windows save dialog box i.e.(execomma..) and save in text format.

But when the csv data which s shown properly on the screen while getting saved does not get in the same format as displayed on the screen.

felx thomas,123,50.60,34,56.89

the above the example is displayed on the browser after saving in text format it becomes


the display goes to second line in txt file becuase there is a space between felix and thomas , it happens in those names only where there is a space between names.

I tried using xsl utput method="text" indent="yes"/>
but since i have a save button to be displayed it does not get displayed.
<xsl:text> works fine if hard core values inside it. but u cannot use another syntax inside xsl:text so it does not work out.

cann anyone help me out please.

Anselm Paulinus
Ranch Hand

Joined: Sep 05, 2003
Posts: 390
Did you try <xsl:text disable-output-escaping="yes"> ?
felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
i tried that too

here is the xsl code below

<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:xlink="">
<xsl:include href = "FormatDate.xsl"/>
<xsl:include href = "selection.xsl"/>
<xsl:variable name="vargrouping" select="//Filters/grouping"/>
<xsl utput method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="MainPage">

Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995

I am not quite sure if a space there can trigger a newline in fact. It may be a "disguised" newline :-). You also can try to put inside "" the strings where you think you can have blanks.

blog -
felix thomas
Ranch Hand

Joined: Jun 10, 2001
Posts: 89
is there any way to make the browser understand that space is not a new line character and hard cord it if wanted when the browser should consider it a new line

please its urgent

I agree. Here's the link:
subject: white space problem
It's not a secret anymore!