Page 1 of 1

Whitespace handling changes in 11.1

Posted: Thu Mar 11, 2010 4:46 pm
by honyk
Hello,

I've just discovered weird behaviour of the white space handling, which differs from version 11.0.
While in 11.0 all images (DocBook document) are inline according to the specificication in the CSS file:

Code: Select all

<inlinemediaobject><imageobject><imagedata
fileref="Icons/IconSave.gif"/></imageobject></inlinemediaobject>
in version 11.1 it is saved the following way:

Code: Select all

<inlinemediaobject>
<imageobject>
<imagedata fileref="Icons/IconSave.gif"/>
</imageobject>
</inlinemediaobject>
To tell the truth, we use the same docbook4.framework file from 11.0 version and I've found there are small changes relative to all lists where xml:space preserve is 'Inside as first child' instead of 'Inside', but there is nothing connected to images.

I need to ensure original behaviour as now there are unintended spaces between text and inline images. Is there any workaround or fix for this? Is it necessary to change something?

Regards,
Jan

Re: Whitespace handling changes in 11.1

Posted: Thu Mar 11, 2010 4:58 pm
by Radu
Hi Jan,

Oxygen 11.1 also looks at the associated DTD information (which is considered more important than the CSS display) to determine whether an XML tag is element only (and it can be indented as a block) or with mixed content (and whitespaces cannot be added in order to indent it).
For example, the Docbook DTD says that inlinemediaobject is element only so the Oxygen format and indenter can format it by adding indent and line breaks. The XML should equivalent in both cases but if you want the old behavior you can go to the Oxygen Preferences Editor / Pages / Author / Schema aware page and uncheck the Schema aware normalization.... checkbox.

Regards,
Radu

Re: Whitespace handling changes in 11.1

Posted: Thu Mar 11, 2010 6:15 pm
by honyk
Thanks for the info, it helped. I am just curious what is the difference between this option and Editor|Format|XML|Schema aware format and indent option. I see the risk these two can interfere.

Jan

Re: Whitespace handling changes in 11.1

Posted: Thu Mar 11, 2010 6:29 pm
by Radu
Hi,

The option you are referring to refers to the format and indent which happens in the Text page (by clicking the "Format and indent" toolbar action for example).
We have a separate checkbox for the Author because the Author looks in the CSS for some situations when schema-aware is enabled and thus has a subordinate checkbox: Indent blocks-only content.
So the two schema aware checkboxes apply to different pages.

Regards,
Radu

Re: Whitespace handling changes in 11.1

Posted: Thu Mar 11, 2010 7:06 pm
by honyk
This sub option is still not very clear to me (maybe some use case could help), but if all this stuff if unchecked, I am still getting slight differences:
Instead of

Code: Select all

<entry colname="col3"> </entry>
I get:

Code: Select all

<entry colname="col3">
</entry>
Or instead of

Code: Select all

<para>Check the appropriate installer files in the <guilabel
>...
this

Code: Select all

 <para>Check the appropriate installer files in the
<guilabel>...
(There is stilll enough place to keep starting element on the same line)

Any idea? It it important for us for version control...
Jan

Re: Whitespace handling changes in 11.1

Posted: Fri Mar 12, 2010 10:22 am
by honyk
To tell the truth, I don't insist on old behaviour. If the current one is the standard for the future, it is Ok. I'd like just avoid another code reformatting in any future version...

Re: Whitespace handling changes in 11.1

Posted: Fri Mar 12, 2010 11:14 am
by Radu
Hi Jan,

We made changes so that format and indent when saving in the Author would be equivalent to format and indent in the Text mode.
For example the author had a tendency to break line between an element's tag start <guilabel and the > even if the element had no attributes, thing which did not happen in the Text mode.
I cannot reproduce the <entry> </entry> being split on multiple lines.

What Oxygen 11.2 will bring in addition to this will be that it will only format and indent the modified elements. So it will be far better for working with version control as XML modifications will be limited to the edited elements.

Regards,
Radu

Re: Whitespace handling changes in 11.1

Posted: Fri Mar 12, 2010 4:10 pm
by honyk
> What Oxygen 11.2 will bring in addition to this will be that it will only format and indent the modified elements.

This sounds really great!

(But I hope there will still be a chance to invoke reformatting for special cases manually)

After some consideration I tend to keep the default Oxygen settings. Our changes via css were almost workarounds and it is not necessary anymore.

There is the only css driven change of a default DocBook DTD behaviour when one combination of elements produces 'preserve-space' code. This, a bit surprisingly after all previously mentioned, works also if 'Schema aware formatting' is checked. I am just currious if this will be 'fixed' (and we will have to choose another approach (XSLT way) to get the intended output).

Regards,
Jan

Re: Whitespace handling changes in 11.1

Posted: Mon Mar 15, 2010 9:42 am
by Radu
Hi Jan,

I should have been more precise.

The "Schema aware format and indent..." does not mean that only the associated schema is taken into account.

In the case of space preserve the following information is used in the following order:
1) If the XML <tag> contains an xml:space attribute or is the descendant of one.
2) If it is in a CSS white-space context.
3) If in the Oxygen Editor/Format/XML preferences page the element is in one if the space-preserve lists
4) If the associated schema specifies a default xml:space attribute for an element.

The same sources are used to consider an element mixed or element-only.

Regards,
Radu