Page 1 of 1

Format and Indent

Posted: Thu Mar 22, 2007 7:08 pm
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,

Posted: Fri Mar 23, 2007 1:06 pm
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

Posted: Tue Aug 14, 2007 9:33 pm
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.

Posted: Wed Aug 15, 2007 3:44 pm
by sorin_ristache
Hello Angela,

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


Regards,
Sorin