Page 1 of 1

Preserve newlines between elements

Posted: Fri Feb 25, 2005 12:11 am
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])

Posted: Fri Feb 25, 2005 11:15 am
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