Re: [oXygen-user] Pretty Print <lb/> in Oxygen

A few hours ago Ute Recker-Hamm posted a wonderful question to TEI-L, the main list for the Text Encoding Initiative.[1] She basically asked "what do y'all do to get your physical lines, as encoded with the empty TEI <lb> element, to line up nicely in oXygen?". I remember asking a similar question a few years ago, and vaguely recall being told that manipulating the options under "Preferences > Editor / Format / XML" (in particular the "Preserve space" and "Default space" lists) should get format-and-indent to do the trick. However, I recall that I never got it working to my satisfaction, and when I look through the archives of this list now, I can't find the answer I recall. So what is "it" that I want format-and-indent to do? When given a text that looks like this: view A ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p> I'd like it to end up formatted as it is now -- with each <lb> starting a new line. If the desired line length were long enough, it wouldn't be changed at all. If the desired line length were shorter, it might look like this: view B ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p> What I *don't* want is for format-and-indent to make it look like this: view C ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p> In fact, if I had my druthers, an input document that looked like view C would come out of the processing looking like view A or B. Note ---- [1] Those of you who are members of a TEI list at Brown can find it at https://listserv.brown.edu/?A2=ind1410&L=tei-l&F=&S=&P=64155. I have not re-produced it here because I did not get the original poster's permission to do so. (Not that I think it is illegal or immoral to re-post without such permission, only that it's rude.)

Hi Syd, I do not think that is possible with any of the current settings.. You should set space preserve on a p or ancestor element and then format it as you want and oXygen's format and indent will leave it like that. <text> <body> <p xml:space="preserve">I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p xml:space="preserve">Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p> </body> </text> Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 27/10/14 19:25, Syd Bauman wrote:
A few hours ago Ute Recker-Hamm posted a wonderful question to TEI-L, the main list for the Text Encoding Initiative.[1]
She basically asked "what do y'all do to get your physical lines, as encoded with the empty TEI <lb> element, to line up nicely in oXygen?".
I remember asking a similar question a few years ago, and vaguely recall being told that manipulating the options under "Preferences > Editor / Format / XML" (in particular the "Preserve space" and "Default space" lists) should get format-and-indent to do the trick. However, I recall that I never got it working to my satisfaction, and when I look through the archives of this list now, I can't find the answer I recall.
So what is "it" that I want format-and-indent to do? When given a text that looks like this:
view A ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
I'd like it to end up formatted as it is now -- with each <lb> starting a new line. If the desired line length were long enough, it wouldn't be changed at all. If the desired line length were shorter, it might look like this:
view B ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
What I *don't* want is for format-and-indent to make it look like this:
view C ---- -
<p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
In fact, if I had my druthers, an input document that looked like view C would come out of the processing looking like view A or B.
Note ---- [1] Those of you who are members of a TEI list at Brown can find it at https://listserv.brown.edu/?A2=ind1410&L=tei-l&F=&S=&P=64155. I have not re-produced it here because I did not get the original poster's permission to do so. (Not that I think it is illegal or immoral to re-post without such permission, only that it's rude.) _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

So just to be clear. What you're saying George is that you basically need to hand format it and then tell Oxygen not to format the parent element (at least in terms of spaces and line breaks). Oxygen's display is CSS driven, isn't it? Is there a technical reason why tei:lb and html:br couldn't be added to the CSS so that they would break? The relevant CSS exists, right? Could a user modify the sheets? Or is some other mechanism used? Or is Syd talking about the editor mode here? On 14-10-27 12:59 PM, George Bina wrote:
Hi Syd,
I do not think that is possible with any of the current settings.. You should set space preserve on a p or ancestor element and then format it as you want and oXygen's format and indent will leave it like that.
<text> <body> <p xml:space="preserve">I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p xml:space="preserve">Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p> </body> </text>
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 27/10/14 19:25, Syd Bauman wrote:
A few hours ago Ute Recker-Hamm posted a wonderful question to TEI-L, the main list for the Text Encoding Initiative.[1]
She basically asked "what do y'all do to get your physical lines, as encoded with the empty TEI <lb> element, to line up nicely in oXygen?".
I remember asking a similar question a few years ago, and vaguely recall being told that manipulating the options under "Preferences > Editor / Format / XML" (in particular the "Preserve space" and "Default space" lists) should get format-and-indent to do the trick. However, I recall that I never got it working to my satisfaction, and when I look through the archives of this list now, I can't find the answer I recall.
So what is "it" that I want format-and-indent to do? When given a text that looks like this:
view A ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
I'd like it to end up formatted as it is now -- with each <lb> starting a new line. If the desired line length were long enough, it wouldn't be changed at all. If the desired line length were shorter, it might look like this:
view B ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
What I *don't* want is for format-and-indent to make it look like this:
view C ---- -
<p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
In fact, if I had my druthers, an input document that looked like view C would come out of the processing looking like view A or B.
Note ---- [1] Those of you who are members of a TEI list at Brown can find it at https://listserv.brown.edu/?A2=ind1410&L=tei-l&F=&S=&P=64155. I have not re-produced it here because I did not get the original poster's permission to do so. (Not that I think it is illegal or immoral to re-post without such permission, only that it's rude.) _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- From my Ubuntu notebook Daniel Paul O'Donnell Professor of English University of Lethbridge Lethbridge AB T1K 3M4 Canada +1 403 393-2539

Hi Daniel, Yes, oXygen already breaks lines at <lb/> elements in Author mode. This is done by making lb a block and displaying an empty string as its content, thus making it invisible but forcing the following text to go on a new line: lb:before{ content:""; } lb { display:block; } Users can also modify the CSS files if they want to or provide additional or alternate CSS rules either at the framework level or directly within the document itself, in the later case using an xml-stylesheet processing instruction. Syd was talking about the Text editing mode. We treat space preserve versus mixed content versus element only content but the semantics of lb is somehow special... For example, if we have: <p>test<lb/>new line</p> Then oXygen will consider this as mixed content and it will not add new whitespace where there is none, that means it will never add whitespace immediately before or after <lb/> in this case. This <p>test <lb/>new line</p> is not equivalent to the original is you apply a space normalization algorithm on the text content of the p element but in this case the semantics of <lb/> itself implies a whitespace so theoretically they are equivalent. However, there is no way to say in a schema language that an element represents whitespace, so oXygen cannot infer that information from the schema. I guess that may be yet another option, plus the choices to define where to split the line on formatting, for example the following is also a possible option: <p>test<lb/> new line</p> or <p>test <lb/> new line</p> Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 27/10/14 21:49, Daniel O'Donnell wrote:
So just to be clear. What you're saying George is that you basically need to hand format it and then tell Oxygen not to format the parent element (at least in terms of spaces and line breaks).
Oxygen's display is CSS driven, isn't it? Is there a technical reason why tei:lb and html:br couldn't be added to the CSS so that they would break? The relevant CSS exists, right? Could a user modify the sheets? Or is some other mechanism used?
Or is Syd talking about the editor mode here?
On 14-10-27 12:59 PM, George Bina wrote:
Hi Syd,
I do not think that is possible with any of the current settings.. You should set space preserve on a p or ancestor element and then format it as you want and oXygen's format and indent will leave it like that.
<text> <body> <p xml:space="preserve">I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p xml:space="preserve">Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p> </body> </text>
Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com
On 27/10/14 19:25, Syd Bauman wrote:
A few hours ago Ute Recker-Hamm posted a wonderful question to TEI-L, the main list for the Text Encoding Initiative.[1]
She basically asked "what do y'all do to get your physical lines, as encoded with the empty TEI <lb> element, to line up nicely in oXygen?".
I remember asking a similar question a few years ago, and vaguely recall being told that manipulating the options under "Preferences > Editor / Format / XML" (in particular the "Preserve space" and "Default space" lists) should get format-and-indent to do the trick. However, I recall that I never got it working to my satisfaction, and when I look through the archives of this list now, I can't find the answer I recall.
So what is "it" that I want format-and-indent to do? When given a text that looks like this:
view A ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
I'd like it to end up formatted as it is now -- with each <lb> starting a new line. If the desired line length were long enough, it wouldn't be changed at all. If the desired line length were shorter, it might look like this:
view B ---- - <p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
What I *don't* want is for format-and-indent to make it look like this:
view C ---- -
<p>I call our world Flatland, not because we call it so, but to make <lb/>its nature clearer to you, my happy readers, who are privileged to live <lb/>in Space.</p> <p>Imagine a vast sheet of paper on which straight Lines, Triangles, <lb/>Squares, Pentagons, Hexagons, and other figures, instead of remaining <lb/>fixed in their places, move freely about, on or in the surface, but without <lb/>the power of rising above or sinking below it, very much like shadows <lb/>—only hard with luminous edges—and you will then have a pretty <lb/>correct notion of my country and countrymen. Alas, a few years ago, <lb/>I should have said “my universe:” but now my mind has been opened <lb/>to higher views of things.</p>
In fact, if I had my druthers, an input document that looked like view C would come out of the processing looking like view A or B.
Note ---- [1] Those of you who are members of a TEI list at Brown can find it at https://listserv.brown.edu/?A2=ind1410&L=tei-l&F=&S=&P=64155. I have not re-produced it here because I did not get the original poster's permission to do so. (Not that I think it is illegal or immoral to re-post without such permission, only that it's rude.) _______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi all, * George Bina dixit [2014-10-28 00:02]:
Syd was talking about the Text editing mode. We treat space preserve versus mixed content versus element only content but the semantics of lb is somehow special... For example, if we have:
<p>test<lb/>new line</p>
Then oXygen will consider this as mixed content and it will not add new whitespace where there is none, that means it will never add whitespace immediately before or after <lb/> in this case. This
<p>test <lb/>new line</p>
is not equivalent to the original is you apply a space normalization algorithm on the text content of the p element but in this case the semantics of <lb/> itself implies a whitespace so theoretically they are equivalent.
I would like to reaffirm the non-equivalence of the two examples and add a use case. In fact, <lb/> is even more special: It is member of the att.breaking group, so an additional attribute @break specifies whether or not an instance of <lb/> implies whitespace or not. You cannot by the mere presence of the <lb/> element decide whether or not whitespace should be present or not. In our texts we have lots of word breaks across lines (some of which are marked with a hyphenation dash and some of which are not), so we use <lb/> and <lb break="no"/> - and the latter comes in two flavours again: <lb break="no" rendition="#hyphen"/> and <lb break="no" rendition="#noHyphen"/>. Adding whitespace around the non-breaking <lb/>s would in fact corrupt our documents, making tokenizations algorithms that are aware of the "non-breakingness" of those <lb/>s fail. In our author mode css, we try to display these various cases this way: lb{ display:inline; -oxy-display-tags:none; } lb:before{ content:"\A("attr(n)") ‣ "; font-size:0.6em; white-space: pre-line; } lb[rendition="#hyphen"]:before{ content:"¬\A("attr(n)") ‣ "; font-size:0.6em; white-space: pre-line; } lb[rendition="#noHyphen"]:before{ content:"[¬]\A("attr(n)") ‣ "; font-size:0.6em; white-space: pre-line; } (And then there is some stuff to prevent those "manually added" linebreaks (\A) in the :before selectors in the case of the first line of a paragraph/heading etc. But this doesn't work 100%... The point is, we have a second "style" css which eliminates the linebreaks and renders the text according to the dimensions of the current window: @import url("standard.css"); lb[rendition="#hyphen"]:before{ content:""; } lb[rendition="#noHyphen"]:before{ content:""; } In the case of non-breaking <lb/> this reconstructs the hyphenated/broken words correctly. (And in the case of breaking <lb/> we have whitespace around the <lb/> in our xml sources anyway. But for this whole setup it is crucial that oXygen does not mess with whitespace around <lb/>s. Our sources, after manual formatting, look like this: <lb n="01" />OFFICIUM, ac munus Theologi <lb n="02" />tam latè patet, ut nullum argumen<lb break="no" rendition="#hyphen" n="03" />tum, nulla disputatio, nullus locus <lb n="04" />alienus videatur à theologica profes<lb break="no" rendition="#noHyphen" n="05" />sione, et instituto. <lb n="06" />... (Unfortunately, it keeps getting messed up, but I think this is due to our XML database (eXist) storing the file internaly as an xml tree and forgetting all the layout and serializing it according to less sophisticated rules when opening it in Oxygen. However, this concerns only the linebreaks in our xml files, not the <lb/> elements and the whitespace around them, so it does not affect our ability to offer the same rendering options to a viewer via xslt...) Bottom line: Please don't mess with whitespace around <lb/> elements (or if you do, offer an option to disable this). There are use cases explicitly provided for by the <lb/> element and its attributes where the exact placement of whitespace is crucial. Cheers, Andreas -- Dr. Andreas Wagner Project "The School of Salamanca" Academy of Sciences and Literature, Mainz and Institute of Philosophy Goethe University Frankfurt http://salamanca.adwmainz.de IGF HP 25 / R 2.455 Grüneburgplatz 1 60629 Frankfurt am Main Tel. +49 (0)69/798-32774 Fax +49 (0)69/798-32794

Thanks Andreas! This shows that "lb" handling is a lot more complex :). Ute, is the use of xml:space enough for you to control this? To automate formatting you can normalize the element that contains the <lb/> occurrences on one line and then replace " <lb/>" with a new line followed by <lb/> using the find/replace in files and then you may also use indent/unindent selection (tab / Shoft+Tab) to indent that as you want. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 28/10/14 11:53, Andreas Wagner wrote:
Hi all,
* George Bina dixit [2014-10-28 00:02]:
Syd was talking about the Text editing mode. We treat space preserve versus mixed content versus element only content but the semantics of lb is somehow special... For example, if we have:
<p>test<lb/>new line</p>
Then oXygen will consider this as mixed content and it will not add new whitespace where there is none, that means it will never add whitespace immediately before or after <lb/> in this case. This
<p>test <lb/>new line</p>
is not equivalent to the original is you apply a space normalization algorithm on the text content of the p element but in this case the semantics of <lb/> itself implies a whitespace so theoretically they are equivalent.
I would like to reaffirm the non-equivalence of the two examples and add a use case. In fact, <lb/> is even more special: It is member of the att.breaking group, so an additional attribute @break specifies whether or not an instance of <lb/> implies whitespace or not. You cannot by the mere presence of the <lb/> element decide whether or not whitespace should be present or not.
In our texts we have lots of word breaks across lines (some of which are marked with a hyphenation dash and some of which are not), so we use <lb/> and <lb break="no"/> - and the latter comes in two flavours again: <lb break="no" rendition="#hyphen"/> and <lb break="no" rendition="#noHyphen"/>.
Adding whitespace around the non-breaking <lb/>s would in fact corrupt our documents, making tokenizations algorithms that are aware of the "non-breakingness" of those <lb/>s fail.
In our author mode css, we try to display these various cases this way:
lb{ display:inline; -oxy-display-tags:none; }
lb:before{ content:"\A("attr(n)") ‣ "; font-size:0.6em; white-space: pre-line; }
lb[rendition="#hyphen"]:before{ content:"¬\A("attr(n)") ‣ "; font-size:0.6em; white-space: pre-line; }
lb[rendition="#noHyphen"]:before{ content:"[¬]\A("attr(n)") ‣ "; font-size:0.6em; white-space: pre-line; }
(And then there is some stuff to prevent those "manually added" linebreaks (\A) in the :before selectors in the case of the first line of a paragraph/heading etc. But this doesn't work 100%...
The point is, we have a second "style" css which eliminates the linebreaks and renders the text according to the dimensions of the current window:
@import url("standard.css");
lb[rendition="#hyphen"]:before{ content:""; }
lb[rendition="#noHyphen"]:before{ content:""; }
In the case of non-breaking <lb/> this reconstructs the hyphenated/broken words correctly. (And in the case of breaking <lb/> we have whitespace around the <lb/> in our xml sources anyway. But for this whole setup it is crucial that oXygen does not mess with whitespace around <lb/>s. Our sources, after manual formatting, look like this:
<lb n="01" />OFFICIUM, ac munus Theologi <lb n="02" />tam latè patet, ut nullum argumen<lb break="no" rendition="#hyphen" n="03" />tum, nulla disputatio, nullus locus <lb n="04" />alienus videatur à theologica profes<lb break="no" rendition="#noHyphen" n="05" />sione, et instituto. <lb n="06" />...
(Unfortunately, it keeps getting messed up, but I think this is due to our XML database (eXist) storing the file internaly as an xml tree and forgetting all the layout and serializing it according to less sophisticated rules when opening it in Oxygen. However, this concerns only the linebreaks in our xml files, not the <lb/> elements and the whitespace around them, so it does not affect our ability to offer the same rendering options to a viewer via xslt...)
Bottom line: Please don't mess with whitespace around <lb/> elements (or if you do, offer an option to disable this). There are use cases explicitly provided for by the <lb/> element and its attributes where the exact placement of whitespace is crucial.
Cheers,
Andreas
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Dear all, I share Ute's wish for a format-and-indent in the text mode that puts <lb> at the beginning of each line. xml:space does not seem satisfying to me because it prevents Oxygen from doing any format-and-indent. Find/replace is neither very elegant nor will it give the result Syd has described. I admit that the addition of whitespace in mixed content elements where no whitespace exists is generally critical (and I like Oxygen for not doing this!). However, any whitespace preceding or following an <lb> can be treated as insignificant. Even Oxy<lb break="no">gen Oxy <lb break="no">gen are equivalent, except that a little more processing is needed to extract the token "Oxygen" from such an encoding. So I find it responsible to allow Oxygen---on explicit request---to add whitespace befor <lb> elements. At least, it would be nice to get Oxygen to put all the <lb>s at the beginning of the line that *already have* whitespace before them. Best regards, Gerrit Am 28.10.2014 13:56, schrieb George Bina:
Thanks Andreas! This shows that "lb" handling is a lot more complex :).
Ute, is the use of xml:space enough for you to control this? To automate formatting you can normalize the element that contains the <lb/> occurrences on one line and then replace " <lb/>" with a new line followed by <lb/> using the find/replace in files and then you may also use indent/unindent selection (tab / Shoft+Tab) to indent that as you want.
Best Regards, George --
-- Gerrit Brüning Goethe-Universität Frankfurt am Main | Institut für deutsche Literatur und ihre Didaktik Historisch-kritische Edition von Goethes Faust | Genetic Edition of Goethe's Faust | faustedition.net Freies Deutsches Hochstift | Großer Hirschgraben 23-25 | 60311 Frankfurt am Main | Fon +49(0)69-13880-292

I agree with Gerrit; while all Andreas says is true, it is not an argument against having an option for format-and-indent to intelligently insert specific whitespace in front of (or after) desired elements. (Not only are we suggesting this as an option, I suspect all of us on the "I like this feature" side would agree it should be an option that is off by default, for the very reasons Andreas articulates :-) E.g., adding two new tabs to Options > Preferences / Editor / Format / XML / Element Spacing: 1) Starts new line: Element names or XPath expressions for which the start-tag (or empty-element tag) should be forced to start on a new line (and then indented appropriately) 2) Ends line: Element names or XPath expressions for which the start-tag (or empty-element tag) should be made the last token on a line Both lists should start out empty, of course. P.S. IIRC, last I checked (years ago) those were not "XPath expressions", they were not even full XSLT patterns, but rather were a very limited set of XSLT patterns. If that is still true, I would strongly recommend changing the wording slightly and putting some pop-up help or information right there.
I share Ute's wish for a format-and-indent in the text mode that puts <lb> at the beginning of each line. xml:space does not seem satisfying to me because it prevents Oxygen from doing any format-and-indent. Find/replace is neither very elegant nor will it give the result Syd has described.
I admit that the addition of whitespace in mixed content elements where no whitespace exists is generally critical (and I like Oxygen for not doing this!). However, any whitespace preceding or following an <lb> can be treated as insignificant. Even
Oxy<lb break="no">gen
Oxy <lb break="no">gen
are equivalent, except that a little more processing is needed to extract the token "Oxygen" from such an encoding. So I find it responsible to allow Oxygen---on explicit request---to add whitespace befor <lb> elements. At least, it would be nice to get Oxygen to put all the <lb>s at the beginning of the line that *already have* whitespace before them.

Syd and Gerrit, I am so behind! (on old messages to mailing lists) -- In the meantime, until oXygen does everything perfectly, could one perhaps introduce the LF characters you want (in your mixed content) using XQuery update (which works in oXygen's XQuery Builder), or (gasp!) plain-text s/r over the raw XML? Cheers, Wendell On Tue, Oct 28, 2014 at 5:06 PM, Syd Bauman <syd@paramedic.wwp.neu.edu> wrote:
I agree with Gerrit; while all Andreas says is true, it is not an argument against having an option for format-and-indent to intelligently insert specific whitespace in front of (or after) desired elements. (Not only are we suggesting this as an option, I suspect all of us on the "I like this feature" side would agree it should be an option that is off by default, for the very reasons Andreas articulates :-)
E.g., adding two new tabs to Options > Preferences / Editor / Format / XML / Element Spacing:
1) Starts new line: Element names or XPath expressions for which the start-tag (or empty-element tag) should be forced to start on a new line (and then indented appropriately)
2) Ends line: Element names or XPath expressions for which the start-tag (or empty-element tag) should be made the last token on a line
Both lists should start out empty, of course.
P.S. IIRC, last I checked (years ago) those were not "XPath expressions", they were not even full XSLT patterns, but rather were a very limited set of XSLT patterns. If that is still true, I would strongly recommend changing the wording slightly and putting some pop-up help or information right there.
I share Ute's wish for a format-and-indent in the text mode that puts <lb> at the beginning of each line. xml:space does not seem satisfying to me because it prevents Oxygen from doing any format-and-indent. Find/replace is neither very elegant nor will it give the result Syd has described.
I admit that the addition of whitespace in mixed content elements where no whitespace exists is generally critical (and I like Oxygen for not doing this!). However, any whitespace preceding or following an <lb> can be treated as insignificant. Even
Oxy<lb break="no">gen
Oxy <lb break="no">gen
are equivalent, except that a little more processing is needed to extract the token "Oxygen" from such an encoding. So I find it responsible to allow Oxygen---on explicit request---to add whitespace befor <lb> elements. At least, it would be nice to get Oxygen to put all the <lb>s at the beginning of the line that *already have* whitespace before them.
oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^

Dear all, In Oxygen version 17.1 you have the possibility to specify "Line break" elements [1], that is to say elements for which we have to break the line before (or after) serializing them. The entries from this new list are a form of simplified XPath expressions that also accept one attribute condition (default attribute values are not taken into account):/ - element[@attr]/ - Matches all instances of the specified element that include the specified attribute./ - element[not(@attr)]/ - Matches all instances of the specified element that do not include the specified attribute./ - element[@attr = "value"]/ - Matches all instances of the specified element that include the specified attribute with the given value./ - element[@attr != "value"]/ - Matches all instances of the specified element that include the specified attribute and its value is different than the one given. We only accept one attribute condition because we want these expressions to run as fast as possible but nevertheless, it should suffice for writing expression that take into account the @break attribute. Hope it helps! [1] https://www.oxygenxml.com/doc/versions/17.1/ug-editor/#topics/preferences-ed... Best regards, Alex -- Alex Jitianu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 12/17/2014 7:09 PM, Wendell Piez wrote:
Syd and Gerrit,
I am so behind! (on old messages to mailing lists) --
In the meantime, until oXygen does everything perfectly, could one perhaps introduce the LF characters you want (in your mixed content) using XQuery update (which works in oXygen's XQuery Builder), or (gasp!) plain-text s/r over the raw XML?
Cheers, Wendell
On Tue, Oct 28, 2014 at 5:06 PM, Syd Bauman <syd@paramedic.wwp.neu.edu> wrote:
I agree with Gerrit; while all Andreas says is true, it is not an argument against having an option for format-and-indent to intelligently insert specific whitespace in front of (or after) desired elements. (Not only are we suggesting this as an option, I suspect all of us on the "I like this feature" side would agree it should be an option that is off by default, for the very reasons Andreas articulates :-)
E.g., adding two new tabs to Options > Preferences / Editor / Format / XML / Element Spacing:
1) Starts new line: Element names or XPath expressions for which the start-tag (or empty-element tag) should be forced to start on a new line (and then indented appropriately)
2) Ends line: Element names or XPath expressions for which the start-tag (or empty-element tag) should be made the last token on a line
Both lists should start out empty, of course.
P.S. IIRC, last I checked (years ago) those were not "XPath expressions", they were not even full XSLT patterns, but rather were a very limited set of XSLT patterns. If that is still true, I would strongly recommend changing the wording slightly and putting some pop-up help or information right there.
I share Ute's wish for a format-and-indent in the text mode that puts <lb> at the beginning of each line. xml:space does not seem satisfying to me because it prevents Oxygen from doing any format-and-indent. Find/replace is neither very elegant nor will it give the result Syd has described.
I admit that the addition of whitespace in mixed content elements where no whitespace exists is generally critical (and I like Oxygen for not doing this!). However, any whitespace preceding or following an <lb> can be treated as insignificant. Even
Oxy<lb break="no">gen
Oxy <lb break="no">gen
are equivalent, except that a little more processing is needed to extract the token "Oxygen" from such an encoding. So I find it responsible to allow Oxygen---on explicit request---to add whitespace befor <lb> elements. At least, it would be nice to get Oxygen to put all the <lb>s at the beginning of the line that *already have* whitespace before them.
oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (7)
-
Alex Jitianu
-
Andreas Wagner
-
Daniel O'Donnell
-
George Bina
-
Gerrit Brüning
-
Syd Bauman
-
Wendell Piez