XSLT2.0 Copy of CDATA into txt file under Windows and using it withUnix/Linux

Discussion in 'XML' started by RolfK, Jan 16, 2008.

  1. RolfK

    RolfK Guest

    Hello Experts,

    I have a small problem with copy of CDATA sections.
    (I'm using XSLT2.0 )

    My output target is defined as txt.
    In my xml source is a CDATA section to be put as it is into the output
    text file.
    This CDATA will be copied to the output by xsl:value-of or xsl:copy-
    of.

    The point is that the result text file is created on Windows but used
    on Unix/Linux later on.

    In the Unix world I see strange charcters im my text (like ^M) and
    some line breaks are missing.
    So I think this is a CRLF problem, because of the CDATA section and
    text output.

    Questions:
    1) Is my assumption right ?

    2) How to get the right output for Unix/Linux when running the
    transformatio nunder Windows ?

    May be I can declare the default output for CRLF for txt outputs
    somehow.
    I have used Altova in this case.

    Any hint is welcome

    Rolf
     
    RolfK, Jan 16, 2008
    #1
    1. Advertising

  2. Re: XSLT2.0 Copy of CDATA into txt file under Windows and using itwith Unix/Linux

    Not an XML issue. Nothing to do with CDATA sections. Basic operating
    system conventions.

    Windows expresses line break as two characters: CR (ASCII 13, control-M)
    followed by LF (ASCII 10, control-J).

    Unix expresses line break as one character: LF.

    When you move a text file from one platform to the other, it is your
    responsibility to convert line breaks appropriately, either at the time
    you move the file over or by telling the tools which one to expect (or
    by picking tools that will accept either).

    Note that an XML parser is an example of the latter. XML normalizes line
    breaks, accepting any of several standard forms (including these) as
    equivalent to a single LF character.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Jan 16, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Davison
    Replies:
    1
    Views:
    584
    Hal Rosser
    Jul 7, 2004
  2. hshdude
    Replies:
    12
    Views:
    1,065
    Dimitri Maziuk
    Nov 4, 2004
  3. Replies:
    3
    Views:
    755
    Joe Kesselman
    Mar 6, 2006
  4. Replies:
    0
    Views:
    595
  5. Sameen
    Replies:
    2
    Views:
    446
    Victor Bazarov
    Aug 29, 2005
Loading...

Share This Page