Author mode - reformatting during save
Oxygen general issues.
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Author mode - reformatting during save
Hello,
I am quite confused with autoformat when saving document in Author mode. In my docbook document (v4.4) there is bookinfo element with title, releaseinfo and corpname elements. If file is opened in text mode and Format and Indent action is applied, bookinfo, title, releaseinfo and corname elements are on separate lines. If view is switched into Author mode, slight change is made and this document is saved, all four elements are 'inline', i.e. one follows another, they are not on separate lines. In css style all these elements are specified as blocks and I really don't know by what this is driven - I've thought it is according 'display' property in css style (inline/block). It is interesting that other elements in bookinfo like address and legalnotice behaves properly. Is there any explanation of this?
Thanks in advance.
Jan
I am quite confused with autoformat when saving document in Author mode. In my docbook document (v4.4) there is bookinfo element with title, releaseinfo and corpname elements. If file is opened in text mode and Format and Indent action is applied, bookinfo, title, releaseinfo and corname elements are on separate lines. If view is switched into Author mode, slight change is made and this document is saved, all four elements are 'inline', i.e. one follows another, they are not on separate lines. In css style all these elements are specified as blocks and I really don't know by what this is driven - I've thought it is according 'display' property in css style (inline/block). It is interesting that other elements in bookinfo like address and legalnotice behaves properly. Is there any explanation of this?
Thanks in advance.
Jan
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - reformatting during save
Post by sorin_ristache »
Hello,
The display property is applied when saving the document or when switching to Text mode.
What do you have inside bookinfo after save or switch to Text mode?
Regards,
Sorin
Do you use Oxygen 10.3? The DocBook elements releaseinfo and corpname have display:inline. In what CSS did you see that they are specified as block?honyk wrote:In css style all these elements are specified as blocks and I really don't know by what this is driven - I've thought it is according 'display' property in css style (inline/block).
The display property is applied when saving the document or when switching to Text mode.
I am sorry, I cannot reproduce the problem. After a save in Author mode or after a switch from Author mode to Text mode the elements are not on the same line as you see below. I have the maximum length limit for a line of text set to 1000 characters.honyk wrote:If view is switched into Author mode, slight change is made and this document is saved, all four elements are 'inline', i.e. one follows another, they are not on separate lines.
Code: Select all
<book>
<bookinfo><title>Book Template Title</title>
<releaseinfo>Some info.</releaseinfo>
<corpname>Corp name.</corpname>
<address>The address.</address><legalnotice>
<para>Legal notice.</para>
</legalnotice><author>
<firstname>Author First Name</firstname>
<surname>Author Last Name</surname>
</author></bookinfo>
<part>
<title>First Part </title>
<chapter>
<title>Chapter Title</title>
<sect1>
<title>Section1 Title</title>
<para>Text modif.</para>
</sect1>
</chapter>
</part>
</book>
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - reformatting during save
There must be some mistake on my side, but I can't locate it. This is result after saving your source in Author mode:
And here is code after Format & Indent of source (after switching saved document from Author mode):
This second result is exactly what is defined in my css (I've modified original css and set some inline elements to be displayed as block). For example releaseinfo element is specified there twice:
This kind of overriding is used several times and it works properly. If the first part (inline specification) is commented, the result is the same.
Is css inline/block settings really used for saving in Author mode?
Code: Select all
<book>
<bookinfo><title>Book Template Title</title><releaseinfo>Some info.</releaseinfo><corpname>Corp
name.</corpname>
<address>The address.</address><legalnotice>
<para>Legal notice.</para>
</legalnotice><author>
<firstname>Author First Name</firstname>
<surname>Author Last Name</surname>
</author></bookinfo>
<part>
<title>First Part </title>
<chapter>
<title>Chapter Title</title>
<sect1>
<title>Section1 Title</title>
<para>Text modif.</para>
</sect1>
</chapter>
</part>
</book>
Code: Select all
<book>
<bookinfo>
<title>Book Template Title</title>
<releaseinfo>Some info.</releaseinfo>
<corpname>Corp name.</corpname>
<address>The address.</address>
<legalnotice>
<para>Legal notice.</para>
</legalnotice>
<author>
<firstname>Author First Name</firstname>
<surname>Author Last Name</surname>
</author>
</bookinfo>
<part>
<title>First Part </title>
<chapter>
<title>Chapter Title</title>
<sect1>
<title>Section1 Title</title>
<para>Text modif.</para>
</sect1>
</chapter>
</part>
</book>
Code: Select all
line 2583:
releaseinfo {
display: inline;
}
line 3850:
releaseinfo {
display: block;
}
Is css inline/block settings really used for saving in Author mode?
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - reformatting during save
Post by sorin_ristache »
You have to look at the bookinfo element. If it has display:block the save action of Author mode applied this CSS property correctly.honyk wrote:(I've modified original css and set some inline elements to be displayed as block). For example releaseinfo element is specified there twice:
This kind of overriding is used several times and it works properly. If the first part (inline specification) is commented, the result is the same.Code: Select all
line 2583:
releaseinfo {
display: inline;
}
line 3850:
releaseinfo {
display: block;
}
Is css inline/block settings really used for saving in Author mode?
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - reformatting during save
I've restored css to original one. It works better, but there is also one difference in bookinfo/title. In your example at the top title is just after bookinfo element while in css all titles are specified as block:
I think some my changes of css make it worse, but I suspect it is Oxygen who doesn't process css file properly...
Code: Select all
title,
subtitle,
titleabbrev {
color:#002244;
background-color:inherit;
display:block;
margin:0.3em 0;
}
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - reformatting during save
Post by sorin_ristache »
Do you get different formatting in Text mode inside bookinfo when you switch from Author mode to Text mode and the default CSS (no customizations) of the DocBook document type (that comes with Oxygen) is associated with the XML document? What formatting do you get?honyk wrote:I've restored css to original one. It works better, but there is also one difference in bookinfo/title.
Do you mean Author mode does not display the XML document as specified in the CSS associated with the XML document? Please give an example. If you load the same XML file with the same CSS in a Web browser it is displayed in the same way.honyk wrote:I think some my changes of css make it worse, but I suspect it is Oxygen who doesn't process css file properly...
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - reformatting during save
I probably don't know mechanism of wrapping elements during saving well. I've thought if element is specified in css as block, it will always begin on separate line (be wrapped). What I am trying to express is if bookinfo > title is defined as block element, why it is saved in form of
instead of
I am surprised, that if Format & Indent action is performed, title is on separate line, but if then small change is made in Author mode and such document is saved, title is again just after bookinfo element (the first case above).
Visually everything is correct in Author mode, title is really on separate line. My question is all about source appearance after save from Author mode and difference between this and Format & Indent result.
Code: Select all
<bookinfo><title>My title</title>
Code: Select all
<bookinfo>
<title>My title</title>
Visually everything is correct in Author mode, title is really on separate line. My question is all about source appearance after save from Author mode and difference between this and Format & Indent result.
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: Author mode - reformatting during save
Post by sorin_ristache »
The difference is that when the document is saved in Author mode the CSS display property of the parent element is also important. Element bookinfo has display:block; and does not have a preserve white-space property so the spaces are stripped but because bookinfo has some inline child elements the formatting (inserting newline between bookinfo and title) is not done. Inline elements must be preserved. Maybe we should set in the default CSS for DocBook documents all child elements of bookinfo with display:block so that bookinfo can be formatted as in Text mode.
Regards,
Sorin
Regards,
Sorin
-
- Posts: 176
- Joined: Wed Apr 29, 2009 4:55 pm
Re: Author mode - reformatting during save
Dear Sorin,
thank you very much for this answer, it helped me lot in my understanding this problem. Now it is clear as day. I think it is not necessary to set all bookinfo elements into block, some of them are better inline. Important for me is the fact that we should insist on saving our document in Author mode, or in Text mode, but without previous applying Format & Indent action. With these rules we can eliminate changes not related to the content itself if Diff between both versions is applied.
Thanks again for your patience.
Jan
thank you very much for this answer, it helped me lot in my understanding this problem. Now it is clear as day. I think it is not necessary to set all bookinfo elements into block, some of them are better inline. Important for me is the fact that we should insist on saving our document in Author mode, or in Text mode, but without previous applying Format & Indent action. With these rules we can eliminate changes not related to the content itself if Diff between both versions is applied.
Thanks again for your patience.
Jan
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service