xsl-list
[Top] [All Lists]

Re: [xsl] removing crlf character with out white spaces

2010-11-12 19:02:40
Thanks for the reply it fix my problem.

     Still i was wondering is there a way that  we can remove the spaces from 
the character ~       to linefeed/eod  like the following

LINE1: ISA*00*       *00*       *ZZ*7654321     *ZZ*1234567
LINE2:*020503*1705*^*00401*000010232*0*P*:~
LINE3:GS*HC*7654321 *1234567*20020503*1705*20213*X*004010X096A1~
LINE4:ST*837 *0001~
LINE5:BHT*0019*00*123B*20010329*1310*CH~REF*87*004 010X096A1~

 I am looking for some thing like 

LINE1:ISA*00*       *00*       *ZZ*7654321     *ZZ*1234567
LINE2:*020503*1705*^*00401*000010232*0*P*:~GS*HC*7654321 
*1234567*20020503*1705*20213*X*004010X096A1~ST*837 
*0001~BHT*0019*00*123B*20010329*1310*CH~REF*87*004 010X096A1~

        Dont think about LINE1:,LINE2:,LINE3: and LINE4, for understanding i 
have written edi format like that.

          Basically i need to go charater ~ to line feed and remove the spaces 
b/w them even linefeed and club first line and second line.
             Does any one how ideas how to fix this.

--- On Thu, 11/11/10, Abel Braaksma <abel(_dot_)online(_at_)xs4all(_dot_)nl> 
wrote:

From: Abel Braaksma <abel(_dot_)online(_at_)xs4all(_dot_)nl>
Subject: Re: [xsl] removing crlf character with out white spaces
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Date: Thursday, 11 November, 2010, 1:25 PM
   I dont want to
remove these whitespaces but want to remove the cr's n lf's


See Brandon Ibach's reply, which does exactly that. Make
sure to _not_ 
use normalize-space anymore, just translate(.,
'&_#10;&_#13;', '') 
(remove underscore).

Kind regards,
Abel Braaksma


On 11-11-2010 5:52, ram wrote:
what exactly i am looking is my EDI format is going to
be some thing like this.  I want to remove the carriage
returns and line spaces from this text. There might be white
spaces b/w ISA*00*     
   *00*   *zz*7654321
I am not how many white spaces are going to come.
               
  I dont want to remove these whitespaces but want to
remove the cr's n lf's

ISA*00*       *00* 
     *ZZ*7654321 
   *ZZ*1234567
*020503*1705*^*00401*000010232*0*P*:~GS*HC*7654321
*1234567*20020503*1705*20213*X*004010X096A1~ST*837
*0001~BHT*0019*00*123B*20010329*1310*CH~REF*87*004
010X096A1~NM1*41*2*SUBMITTER
ORGANIZATION*****46*ETIN123~PER*IC*SUBMITTER CONTACT
NAME*TE*SUBMITTER COMM
NUMBER-EMAIL~NM1*40*2*RECEIVER
ORGANIZATION*****46*ETIN123~HL*1**20*1~PRV*BI*ZZ*2
82N00000N~NM1*85*2*BILLINGPROVIDER
ORGANIZATION*****24*EID123456~N3*123
BILLINGPROVIDERADDRESS
LINE~N4*BILLINGPROVIDER
CITY*MD*34567~REF*1C*MEDICAREPN123~HL*2*1*22*1~SBR
*P*18*******MA~NM1*IL*1*SUBSCRIBER-LASTNAME*SUBSCRIBERFIRSTNAME*SUBSCRIBERMI***MI*MEM
BERIDNUMBER123456789~N3*123
SUBSCRIBERADDRESS LINE~N4*SUBSCRIBER


--- On Thu, 11/11/10, Brandon 
Ibach<brandon(_dot_)ibach(_at_)single-sourcing(_dot_)com> 
wrote:

From: Brandon Ibach<brandon(_dot_)ibach(_at_)single-sourcing(_dot_)com>
Subject: Re: [xsl] removing crlf character with
out white spaces
To: "xsl-list"<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Date: Thursday, 11 November, 2010, 9:57 AM
Perhaps something like:

      <xsl:template
match="text()">
       
   <xsl:value-of select="translate(.,
'
', '')" />
   
   </xsl:template>

-Brandon :)


On Wed, Nov 10, 2010 at 11:09 PM, 
ram<ram_kurra(_at_)yahoo(_dot_)co(_dot_)in>
wrote:
Hi,
          I am trying
to write an xsl which will
take read text which is in EDI format and crlf
characters.
My code is
<?xml version="1.0" encoding="UTF-8"?>

     version="1.0"
xmlns:xalan="http://xml.apache.org/xslt";>

     <xsl:template
match="text()">
     
   <xsl:value-of
select="normalize-space()"
/>
     </xsl:template>


     <xsl:template
match="*">
     
   <xsl:copy>
         
   <xsl:copy-of select="@*" />
         
   <xsl:apply-templates />
     
   </xsl:copy>
     </xsl:template>
</xsl:stylesheet>

           
  The normalize-space() is removing
all the crlf characters and also trimming white
spaces
trimming into single space which i dont want to do
it.
i need only cr and line feeds needs to be
removed. How
can i do that.




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or 
e-mail:<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or 
e-mail:<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





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

To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or 
e-mail:<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--