Custom XSL Stylesheets should use xsl:text to allow easier reading / editing
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Confirmed
|
Wishlist
|
Unassigned |
Bug Description
I have poked around in fm_IDL2js.xsl a little bit recently and have noticed that in order to reduce unwanted spaces in the resulting JSON many XSL elements have no whitespace or linebreaks between them. Thisishardtorea
This is necessary because of the way this stylesheet is built. If you use raw text as part of the stylesheet then spaces are kept since there's no way to distinguish the spaces you use to make your stylesheet easier to read vs those that are an important part of your data. Though whitespace between one XML element and another *are* removed, as is the SGML / XML / markup du jour custom.
So, were we to wrap all of our raw text output in fm_IDL2js.xsl* in <xsl:text>
By way of a small example:
...
<xsl:value-of select=
...
and
...
<xsl:if test="@
...
Both output the same text:
id:{name:
But you can tell that line 1 is the overall class definition, line 2 opens the new object and has the name key and value, and line 3 is the label key and value.
This would bloat the xsl file a little bit but I don't believe would be so much that there would be any adverse effects. I'll try to find some time to put together a branch.
*Or any other custom xsl files; I don't recommend we bother with those that are sourced from external locations like the MODS/MADS transforms.
Changed in evergreen: | |
status: | New → Confirmed |
tags: | added: xml-xsl |
tags: | added: cleanup |