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

R

RolfK

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
 
J

Joseph Kesselman

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
473,992
Messages
2,570,220
Members
46,805
Latest member
ClydeHeld1

Latest Threads

Top