Subject: Re: [xsl] Source code formatting From: "Imsieke, Gerrit, le-tex gerrit.imsieke@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Tue, 28 Jul 2020 22:02:02 -0000 |
Hi Willem,
Not sure if this would work with the particular VCS you are using,
but have you considered not to use a formatter when adding the XSLT to the VCS, but tune the actual dif (ignoring whitespace in attributes as an example)
Delta XML have done some work in that area for GIT I believe, maybe you find some inspiration here
https://www.youtube.com/watch?v=YmfzhK4aR1c
Met vriendelijke groeten, Best regards,
Geert Bormans
------------------------------------------------------------------------
*Van: *"Abel Braaksma, (Exselt) abel@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
*Aan: *"xsl-list" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
*Verzonden: *Dinsdag 28 juli 2020 23:18:00
*Onderwerp: *[xsl] Source code formatting
Hi list,
Like many of you, I assume, I use a version control system when working on XSLT projects. I'm working together with multiple people, and we run the code through an XML formatter before checking it in to avoid formatting differences showing up in the diffs.
The problem is that, due to attribute value normalization, carriage returns are removed from attribute nodes during XML parsing. When using long XPath expressions (and this has become very common in XSLT 3, especially with higher order functions), which are split in multiple lines, this results in huge single line outputs which are impossible to read.
It seems any sort of XML processing will irreversibly transform the whitespace, therefore I have to choose between:
- No formatting
- Formatting using non-XML tools?
- Finding a parser that bends the rules...
Have any of you experienced the same problem and did you find a solution?
Thanks.
Willem Van Lishout
willemvanlishout@xxxxxxxxx <mailto:willemvanlishout@xxxxxxxxx>
XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/554170> (by email)
XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/225679> (by email <>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Source code formatting, Geert Bormans geert@ | Thread | Re: [xsl] Source code formatting, John Lumley john@xxx |
Re: [xsl] Source code formatting, Geert Bormans geert@ | Date | Re: [xsl] Source code formatting, Dimitre Novatchev dn |
Month |