Re: Stripping carriage returns

Subject: Re: Stripping carriage returns
From: Dan Vint <dvint@xxxxxxxx>
Date: Thu, 4 May 2000 07:15:21 -0700 (PDT)
This may not be a complete solution but it starts to give you better control:

<xsl:template match="text()"/>

This overrides the default rule that causes text to be generated automatically.
Once you add this, I would then look at your stylesheet and look at the places
where you have used Returns and spaces for formatting the stylesheet, some
of these also get sent to the output.

..dan

> 
> Hi,
> 
> I need to get rid of not only blanks but also carriage returns.
> I've tried <xsl:strip-space elements="*"/> and it won't work with
> Xalan 1.0.0. The output I need is plain text and should be (for this
> example) something like this: 
> 
> 	#.DJI|DJ INDU AVERAGE |10010.73|154.20|1.56|
> 
> and what I actually get as output is:
>  
>         #
>                 .DJI
>         |
>         DJ INDU AVERAGE
>         |
> 10010.73
>         |
> 154.20
>         |
> 1.56
>         | 
> 
> 
> The xml input is:
> 
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> 
> <!-- XML 1030 : Stocks Chain -->
> <ric name=".DJI">
> <fid id="DSPLY_NAME">DJ INDU AVERAGE </fid>
> <fid id="TRDPRC_1">10010.73</fid>
> <fid id="NETCHNG_1">154.20</fid>
> <fid id="PCTCHNG">1.56</fid>
> <fid id="BID">0.00</fid>
> <fid id="ASK">0.00</fid>
> <fid id="HST_CLOSE">9856.53</fid>
> <fid id="ACVOL_1">187359700</fid>
> <fid id="TRDTIM_1">22:01 CET</fid>
> <fid id="TRADE_DATE">09 MAR 2000</fid>
> <fid id="BID_TICK_1">-</fid>
> </ric>
> 
> ----------------------------------
> The style sheet is this:
> 
> <xsl:stylesheet version="1.0"
> 		xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> 
> <xsl:strip-space elements="*"/>
>  
> <xsl:template match="ric">
> 	<![CDATA[#]]>
> 		<xsl:value-of select="@name"/>
> 	<![CDATA[|]]>
> 	<xsl:apply-templates select="fid"/>
> </xsl:template>
> 
> <xsl:template match="fid[@id='DSPLY_NAME']">
> 	<xsl:value-of select="."/>
> 	<![CDATA[|]]>
> </xsl:template>
> 
> <xsl:template match="fid[@id='TRDPRC_1']">
> 	<xsl:value-of select="."/>
> 	<![CDATA[|]]>
> </xsl:template>
> 
> <xsl:template match="fid[@id='NETCHNG_1']">
> 	<xsl:value-of select="."/>
> 	<![CDATA[|]]>
> </xsl:template>
> 
> <xsl:template match="fid[@id='PCTCHNG']">
> 	<xsl:value-of select="."/>
> 	<![CDATA[|]]>
> </xsl:template>
> 
> <xsl:template match="fid[@id='BID']"/>
> 
> <xsl:template match="fid[@id='ASK']"/>
> 
> <xsl:template match="fid[@id='HST_CLOSE']"/>
> 
> <xsl:template match="fid[@id='ACVOL_1']"/>
> 
> <xsl:template match="fid[@id='TRDTIM_1']"/>
> 
> <xsl:template match="fid[@id='TRADE_DATE']"/>
> 
> <xsl:template match="fid[@id='BID_TICK_1']"/>
> 
> </xsl:stylesheet>
> --------------------------------
> As I said before, <xsl:strip-space elements="*"/>
> won't work. Do I have to use extensions (to trim off
> the carriage returns with JavaScript or Java)?.
> 
> Many thanks in advance.
> ------------------------------------------------------------------
> This email is confidential and intended solely for the use of the individual to whom it is addressed. Any views or opinions presented are solely those of the author and do not necessarily represent those of Sema Group. 
> If you are not the intended recipient, be advised that you have received this email in error and that any use, dissemination, forwarding, printing, or copying of this email is strictly prohibited. If you have received this email in error please notify it to Sema Group sae Helpdesk by telephone on number
> +34 91 4408888.
> ------------------------------------------------------------------
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread