Preserve newlines between elements

Are you missing a feature? Request its implementation here.
HomeGoods
Posts: 96
Joined: Wed Feb 09, 2005 8:57 am

Preserve newlines between elements

Post by HomeGoods »

Say there is an XML document:

<root>
<xsl:template match="div1/head|inform-div1/head">
<h2><xsl:call-template name="head"/></h2>
</xsl:template>

<xsl:template match="div2/head">
<h3><xsl:call-template name="head"/></h3>
</xsl:template>

<xsl:template match="div3/head">
<h4><xsl:call-template name="head"/></h4>
</xsl:template>
</root>

and invoke [Document] - [XML Document] - [Format and indent].
It removes newlines between </xsl:template> and <xsl:template>.
I think this makes the document rather hard to read.

It is appreciated if there is an option to keep those newlines. :)
Stylus Studio has it. ([Preserve newlines between elements])
george
Site Admin
Posts: 2096
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

I will add this as an enhancement on our bugzilla.
The way I work for instance is to add a comment between templates. That allowss you to keep them separated after a format and indent action and also to describe what each template does.
Also you may consider using the Indent selection action instead of format and indent. That is available from the contextual menu and performs only line indenting, leaving the same number of lines.

Best Regards,
George
Post Reply