Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
No matter what I do, the output of the Saxon Transformer is always just one single line of text.
I of course use xsl:output method="text" but even If I just want to output
it appears as:
Line 1 Line 2
Why? What am I doint wrong?
We can't tell what you are doing wrong if you don't tell us what you are doing. Show us some code, and we'll help you find the bugs in it. Isolate it to as small a sample as possible to make our job easier.
Also tell us how you are viewing the text. What you see on the screen is not always the same as the bytes stored on disk.
Well, you are right ;-)
I have an XML-File which is not iportant, because in my example don't even fill the created textfile with data from the xml.
I attached the text.xsl file to this post where I just want to output two lines of plain text.
I found out that not even this is done correctly (after I had a much more complicated sample which didn't show any linebreaks either).
Then I start the Transformation with this line:
Transform -t -s:text.xml -xsl:text.xsl -o:output.txt
Sorry, I forgot: The output is the file "output.txt", which I attached to this post.
Attached is a screenshot of your output.txt as it appears on my screen. The line endings are there. Perhaps you are viewing it in a web browser as if it were HTML?
Freaky! No, I use the "normal" Texteditor ("Editor.exe") from Windows.
Interesting: When I add a Linkebreak manually in the output.txt and compare it to it's original version, WinMerge tells me that the linebreaks are in a different format
Is there a way to create "DOS" Linebreaks with xsl?
The line endings in the file are NL characters (x0A). Saxon outputs what it finds in the stylesheet, which after normalization by the XML parser is typically NL. If you want the Windows CRLF line ending you need to generate it explicitly, that is, output & #x0d;& #x0a; Most modern software is happy to accept either form.
This is what I was looking for! Thank you very much!