Author view adds white-space unintended

Post here questions and problems related to oXygen frameworks/document types.
stdu
Posts: 81
Joined: Mon Mar 05, 2012 5:23 pm

Author view adds white-space unintended

Post by stdu » Mon Jul 28, 2014 5:27 pm

Hi,

I've a problem with white-space handling in Oxygen XML Author. If you have this XML (Snippet, of course):

Code: Select all


<Stufe0 id="W00000153">
<Inhalt>
<Kursivtext>Wakermann</Kursivtext> s. <ref ziel="W00000033">Wackermann</ref>
</Inhalt>
</Stufe0>
<Stufe0 id="W00000154">
<Inhalt>Wakin Jakob, Mautner zu St. Veit am Pflaum <Regestennummer>#0-4959</Regestennummer>
</Inhalt>
</Stufe0>
And this CSS:

Code: Select all

Stufe0 {
display: block;
margin: 0.5em 0 0.5em 0;
padding: 0.5em 0 0.5em 0;
border-bottom: 1px solid silver;
}

Inhalt {
display: inline;
-oxy-placeholder-content: "[Hier Text eingeben]";
-oxy-display-tags: none;
}

Kursivtext {
font-style: italic;
-oxy-display-tags: none;
}
results this in this author view (Oxygen 15.2 and 16):

Image

Note, that there is a unintended white-space before the italic text at the beginning of each "Stufe0" tag (tag "Kursivtext" in the xml).

Do you habe a hint, how I could fix it? With

Code: Select all

white-space: -oxy-trim-when-ws-only;
in CSS on "Stufe0" the leading whitespace disappears - but many others problems come up (unintended line breaks etc.).

Thx for every help!
Stefan

alex_jitianu
Posts: 704
Joined: Wed Nov 16, 2005 11:11 am

Re: Author view adds white-space unintended

Post by alex_jitianu » Tue Jul 29, 2014 12:13 pm

Hello Stefan,

From what I understand that extra space remains from the indent inside Inhalt:

Code: Select all

<Inhalt>
<Kursivtext>
Inhalt is mixed (both child elements and text content). It's probably also declared inside the schema as being mixed. Because it's being seen as mixed, that starting indent is considered important and it is normalized instead of being removed altogether. If you use the Pretty Print action from text page on this XML, you will notice that Oxygen doesn't insert an indent inside Inhalt, just because of this reason:

Code: Select all

<Stufe0 id="W00000153">
<Inhalt><Kursivtext>Wakermann</Kursivtext> s. <ref ziel="W00000033">Wackermann</ref></Inhalt>
</Stufe0>
What I'm trying to say is that the indent should not be there in the first place. If you create from scratch an Inhalt element inside Author mode and save, I expect that Inhalt element not to be indented.

Nevertheless, if you already have these indents and want to ignore them, then my suggestion is the same as what you already did, to add -oxy-trim-when-ws-only on Inhalt. Could you show me an example when these setting does bad things? You said something about line breaks. Maybe you could set pre-line on those elements?

Best regards,
Alex

Post Reply