-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question: missing line-break when using XSLT identity transformation #379
Comments
Hmm, this one is a bit tricky, if I turn on "Preserve Whitespace" in the XML Document then you will see this: I assume you do not want to see whitespace like this, or do you? In order to have full control over whitespace in the document (and see it in the XSLT transform) you kind of need this, but it's pretty tedious...? The alternative (1) is I hide all these nodes in the XML notepad UI, but I load the whitespace nodes into the document so XSLT transforms can see the whitespace. Alternative (2) which saves memory, would be to not load any whitespace into the document, but before I run the XSLT transform I save the document with pretty printing turned on (which xml notepad save is doing already) and then I feed that saved document with whitespace to the XSLT transform. The downside of this is that for very large documents this could add a lot of time before you see the XSLT output due to having to save and reload that doc into the transform. What is your preference? |
I ended up adding a new Option under formatting called "Preserve Whitepsace" so you can play with that (in the main branch) and see what you think, after turning it on you will need to reload your XML doc and you will see the above |
Hi Chris I have this XML in UTF-8:
This XSLT (ident copy):
With your xsl.exe 1.0 from your XMLTools 2023-01-27 I use this command: and get this result:
Using the same in XMLNotepad I get this result - with missing line-breaks:
|
Please re-read my answers, this is about "preserving whitespace" in the XML Document, which XML notepad does not do by default. But xsl.exe does preserve the whitespace by default. Try my new Preserve Whitespace setting and you will get the XSL output you are looking for. |
New Preserve Whitespace formatting option is available in https://github.com/microsoft/XmlNotepad/releases/tag/2.9.0.9 |
Thanks, works as expected. |
It seems that I set a wrong configuration ...
I have a simple "XSLT identity transformation", and using it with xsl.exe it works fine and keeps all line-feeds.
When I use it with XmlNotepad, it transform the file too, but removes all line-feeds. I have to reformat it with xmlint.exe.
I changed all my settings for XmNotepad to "Default" - no solution either.
How can I keep the line-feeds?
The text was updated successfully, but these errors were encountered: