XSL whitespace removal after saving file

已回答

Hi,

I recently upgraded the IntelliJ version to IntelliJ IDEA 2024.2.0.1 (Community Edition) (Mac). And I've encountered a problem that after saving XSL/XSLT files white spaces are removed in places that are not needed, for example:

I've got whitespace in between value-of.

<xsl:value-of

<xsl:text> </text>

<xsl:value-of

My project is using stylesheet version="2.0". After saving the file, the whitespace is removed. In the older version (I believe in the 2023 version) this problem didn't occur. In my project, .editorconfig doesn't define a specific .xsl / .xslt formatting.

I've found a few solutions in code, for example, using <xsl:text xml:space="preserve"></xsl:text> where it is needed or even &#160;, but it doesn't seem like a good solution because of IDE's version change. How do I fix it? Should I downgrade my IDE version?

 

Best regards,

Martins

 

0
Hi Mo,

Please go to Settings | Editor | Code Style | XML | Other, and enable "Keep white spaces".
0

Hi,

This didn't solve the problem. 

0
Hi Mo, please submit an issue in https://youtrack.jetbrains.com/issues/IDEA with screenshots and sample projects.
See https://intellij-support.jetbrains.com/hc/articles/207241135 if you are not familiar with YouTrack.
0

请先登录再写评论。