Format and Indent

Are you missing a feature? Request its implementation here.
aintnoprophet
Posts: 4
Joined: Thu Mar 22, 2007 6:42 pm

Format and Indent

Post by aintnoprophet »

It would be nice if the Format and Indent would leave all of an elements attributes on one line.

Is there any way to stop this from happening without having multiple elements on one line?

Example:

<fo:table table-layout="fixed" border-style="solid"
border-width="1.0pt" border-color="#000000">
----<fo:table-column column-width="72.0pt"/>
----<fo:table-column column-width="120.0pt"/>
----<fo:table-column column-width="138.0pt"/>
----<fo:table-column column-width="125.0pt"/>
----<fo:table-column column-width="117.0pt"/>
--------<fo:table-body>
------------<fo:table-row>
----------------<fo:table-cell number-columns-spanned="5"
----------------display-align="before">
--------------------<fo:block>
--------------------<!-- GENERATE TABLE START-->
--------------------<fo:table table-layout="fixed">
--------------------<fo:table-column column-width="32.0pt"/>
--------------------<fo:table-column column-width="95.0pt"/>
--------------------<fo:table-column column-width="320.0pt"/>
--------------------<fo:table-column column-width="124.0pt"/>
--------------------<fo:table-body>
--------------------<fo:table-row>
--------------------<fo:table-cell/>
--------------------<fo:table-cell
--------------------<fo:table-cell
--------------------<display-align="before">
--------------------<<fo:block line-height="10.0pt"
--------------------<white-space-collapse="false"
--------------------<linefeed-treatment="preserve"
--------------------<text-align="start"
--------------------<color="#000000"
--------------------<font-family="Arial"
--------------------<font-size="8.0pt"
--------------------<font-weight="bold">


Why can't it keep indenting?
Why can't it leave an elements attributes on one line?

Am I way off here?

Thanks,
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

The position of the attributes, that is on the same line with the element name or on the next line, depends on the options Break line before attribute's name available in Editor -> Format -> XML, Line width - format and indent available in Editor -> Format and Indent size available in Editor -> Format. If the first option is set to false the position of the attributes depends only on the other two ones. If you want to have all the attributes on the same line you have to increase the line width and/or decrease the indent size because the maximum line width set by the mentioned option cannot be exceeded.


Regards,
Sorin
angela
Posts: 11
Joined: Tue Jan 30, 2007 10:28 pm

Post by angela »

I have the following settings in standalone version 8.2, but Format and Indent is still inserting a line break in the attribute list.

Line width - format and indent = 1000
Indent size = 4 spaces
[ ] Break line before attribute's name
[ x ] Preserve empty lines
[ x ] Preserve text as it is
[ x ] Preserve line breaks in attributes

I want my code to look like this:

Code: Select all


<xsl:variable name="a" select="if (b) 
then b
else if (c)
then c
else d" />
Instead, it looks like this:

Code: Select all


<xsl:variable name="a"
select="if (b)
then b
else if (c)
then c
else d" />
Please advise.
Thanks!
Angela Williams
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello Angela,

Please see the reply to the other post about the same problem.


Regards,
Sorin
Post Reply