Re: [xslt] Controlling EOL Convention with xsltproc

Ron Burk wrote:
> If it's LF internally, then I'll assume that the
> Windows code is probably using C stdio functions
> whose mode is set (by default) to translate LF
> into CR/LF.
> Changing this would likely require something like:
> [snip]

Or, of course, simply using "wb" instead of "w" as argument to fopen();
I don't think it's ever wrong for xsltproc to do that *for XML (or HTML)
For text/plain output, for example, the line endings may be relevant,
and whatever line endings xsltproc chooses to use could be "wrong" in
some context. Choosing to use the "platform default", as is done by
outputting in non-binary mode using a C runtime, is the most sensible
choice IMHO (note that it's not just Windows - MacOS had CR-only line
endings I believe). There's always recode or dos2unix or similar to
transform line endings when moving between systems; heck, ftp in text
mode should do it for you as well.

> Perhaps there is some combination of encoding and
> media-type that could reasonably be expected to
> produce LF-only EOL output.

No, there isn't - I suppose it might not be such a bad thing to have
some attribute or media type to specify it (e.g. line-endings="crlf",
or "text/plain+lf"). For an XML file itself it should not matter, but
for the output of a transform it might.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]