Page 1 of 1

Saving map from DITA Maps Mgr removes blank lines

Posted: Sun Feb 24, 2013 10:25 am
by Erlend L
I like having some "air" in my maps, so I separate sections of the maps with blank lines and comments, like this:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="vdd" outputclass="topic-numbering draft">
<title>Version Description Document</title>

<!-- generic topics -->
<topicref href="vdd/meta/toc-introduction.dita">
<topicref href="vdd/concept/background.dita"/>
</topicref>

<!-- generic topics -->
<topicref href="poc/concept/poc-main.dita"/>

<!-- conref resources -->
<keydef href="resource/windows.dita" keys="windows" type="topic"/>
<keydef href="resource/virt.dita" keys="virt" type="concept"/>
<keydef href="release/gen075/resource/release-conrefsrc.dita" keys="release" type="topic"/>
<keydef href="release/gen075/resource/release-conrefsrc.g.dita" keys="release.g" type="topic"/>

<!-- keydef resources -->
<topicref href="release/gen075/resource/release-keydefsrc.ditamap" format="ditamap"/>
<topicref href="release/gen075/resource/release-keydefsrc.g.ditamap" format="ditamap"/>

</map>
I used Eclipse Juno SR 1 (20121004-1855) with oXygen XML Author 14.1.0.v2012121012. I have selected Preferences, Author>Editor>Format>XML, Select Preserve empty lines, so that when I use Ctrl-Shift-F on the map above in the editor (Text view), the Format and Indent operation will leave the blank lines in there. So far so good.

However, if I open the map and edit it in the DITA Maps Manager (for example by dragging a new topic into the map) and then save it from the Maps Manager, the blank lines are removed and I end up with this solid block of text:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="vdd" outputclass="topic-numbering draft">
<title>Version Description Document</title>
<!-- generic topics -->
<topicref href="vdd/meta/toc-introduction.dita">
<topicref href="vdd/concept/background.dita"/>
</topicref>
<!-- generic topics -->
<topicref href="poc/concept/poc-main.dita"/>
<!-- conref resources -->
<keydef href="resource/windows.dita" keys="windows" type="topic"/>
<keydef href="resource/virt.dita" keys="virt" type="concept"/>
<keydef href="release/gen075/resource/release-conrefsrc.dita" keys="release" type="topic"/>
<keydef href="release/gen075/resource/release-conrefsrc.g.dita" keys="release.g" type="topic"/>
<!-- keydef resources -->
<topicref href="release/gen075/resource/release-keydefsrc.ditamap" format="ditamap"/>
<topicref href="release/gen075/resource/release-keydefsrc.g.ditamap" format="ditamap"/>
</map>
How can I prevent DITA Maps Manager from removing the blank lines?

Re: Saving map from DITA Maps Mgr removes blank lines

Posted: Mon Feb 25, 2013 1:17 pm
by Radu
Hi Erlend,

You are right and we'll try to fix this on our side.
I'll update the thread when we do.

Regards,
Radu

Re: Saving map from DITA Maps Mgr removes blank lines

Posted: Tue Feb 26, 2013 7:47 pm
by Erlend L
Thanks Radu; merely a nuisance, but nice the get fixed; it is so much easier to use the DITA Maps Manager when restructuring a document compared to moving text around.

- Erlend

Re: Saving map from DITA Maps Mgr removes blank lines

Posted: Wed Feb 27, 2013 10:15 am
by Radu
Hi Erlend,

In the Oxygen plugin Preferences there is an "Author" page.
That page contains a radio control called "Format and indent" which by default indents only the modified content.
The setting was disregarded in the DITA Maps Manager editor which formatted the entire file and this will be fixed.

About the Preserve empty lines setting you mentioned previously, it is disregarded when working in the Author mode or in the DITA Maps manager because the original XML content is normalized in order to be presented without extra white spaces and the original line break information is lost.

But because of fixing the first setting I mentioned, the line breaks will be preserved in all nodes which are not modified in the DITA Maps Manager editor.

So the behavior will be better but not perfect.

Regards,
Radu

Re: Saving map from DITA Maps Mgr removes blank lines

Posted: Tue Jun 11, 2013 3:51 pm
by Radu
Hi Erlend,

We released Oxygen 15.0 and it should do a better job of perfectly preserving the unmodified parts of the DITA Map on save.

Regards,
Radu