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

RolfK

Usenet Archive
Joined
Dec 17, 2007
Messages
34
Reaction score
0
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
 

Joseph Kesselman

Usenet Archive
Joined
Feb 3, 2006
Messages
733
Reaction score
0
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,244
Members
248,133
Latest member
DujonT

Latest Threads

Top