Pretty Print breaking XHTML formatting badly
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 3
- Joined: Mon Jul 05, 2010 12:37 am
Pretty Print breaking XHTML formatting badly
First, let me admit that I am a neophyte user of Oxygen XML, and mostly just use it for XHTML documents. I very much like the pretty print feature, but it does one thing that very much annoys me, and has caused me some trouble. (I am hoping that there is an easy solution, and will happily accept that its being revealed also reveals my own lack of competency.) If I have the following portion of an XHTML document:
<div class="boxbrdlinner">
<div id="pnlnavttl">
<h1 class="navttl"> Text: Edgar Allan Poe, “<a href="../info/pt042.htm">The Gold-Bug</a>” (Text-B), <a
href="../editions/tales.htm">
<i>Tales</i></a>, 1845, pp. 1-36 </h1>
</div>
</div>
Pretty print insists on doing this to it:
<div class="boxbrdlinner">
<div id="pnlnavttl">
<h1 class="navttl"> Text: Edgar Allan Poe, “<a href="../info/pt042.htm">The Gold-Bug</a>” (Text-B), <a
href="../editions/tales.htm">
<i>Tales</i>
</a>, 1845, pp. 1-36 </h1>
</div>
</div>
Note that it has broken the </a> end of the <a href> to a new line, which implies an extra space that will appear as underlined with the page is rendered. The complication seems to be the back to back placement of the end of the italic mark </i> and the end of the link </a>. What is odd is that if I add any character, such as this:
<i>Tales</i>x</a>
then it will not break at this point. This solution, of course is not really workable as I do not want a character here. I have compromised somewhat by adding this:
<i>Tales</i>­</a>
which works well, the ­ being ignored unless the line happens to break at this point in rendering, in which case I get the undesirable hyphen. I have tried to find an equivalent XHTML character that will simply be ignored in rendering, but to no avail. (Most character seem to end up as a space, no matter what I do.)
Am I missing something obvious in the setting the editor format preferences? I really just don't want these end tags to be forced to a new line. Any assistance would be appreciated, and I would be happy to provide additional information if what I have posted is unclear or insufficient.
<div class="boxbrdlinner">
<div id="pnlnavttl">
<h1 class="navttl"> Text: Edgar Allan Poe, “<a href="../info/pt042.htm">The Gold-Bug</a>” (Text-B), <a
href="../editions/tales.htm">
<i>Tales</i></a>, 1845, pp. 1-36 </h1>
</div>
</div>
Pretty print insists on doing this to it:
<div class="boxbrdlinner">
<div id="pnlnavttl">
<h1 class="navttl"> Text: Edgar Allan Poe, “<a href="../info/pt042.htm">The Gold-Bug</a>” (Text-B), <a
href="../editions/tales.htm">
<i>Tales</i>
</a>, 1845, pp. 1-36 </h1>
</div>
</div>
Note that it has broken the </a> end of the <a href> to a new line, which implies an extra space that will appear as underlined with the page is rendered. The complication seems to be the back to back placement of the end of the italic mark </i> and the end of the link </a>. What is odd is that if I add any character, such as this:
<i>Tales</i>x</a>
then it will not break at this point. This solution, of course is not really workable as I do not want a character here. I have compromised somewhat by adding this:
<i>Tales</i>­</a>
which works well, the ­ being ignored unless the line happens to break at this point in rendering, in which case I get the undesirable hyphen. I have tried to find an equivalent XHTML character that will simply be ignored in rendering, but to no avail. (Most character seem to end up as a space, no matter what I do.)
Am I missing something obvious in the setting the editor format preferences? I really just don't want these end tags to be forced to a new line. Any assistance would be appreciated, and I would be happy to provide additional information if what I have posted is unclear or insufficient.
-
- Posts: 9440
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Pretty Print breaking XHTML formatting badly
Hi,
You do not specify what Oxygen version you are using.
For example you should no longer encounter this problem in Oxygen 11.2.
Oxygen 11.2 in the Preferences->"Editor / Format / XML" page contains a checkbox called Schema aware format and indent which is checked by default and if checked should detect that inserting a new line between the </i> and the </a> is prohibited.
Oxygen 12 will come with other XHTML pretty-print improvements like correct formatting for empty elements.
For example <br /> elements will be formatted with a space before the > but the <script></script> will be kept with the expanded form and not collapsed to <script/>.
Basically it will respect the XHTML guidelines:
http://www.w3.org/TR/xhtml1/#guidelines
So if you want to test an Oxygen 12 beta just write us an email to the support email address.
Regards,
Radu
You do not specify what Oxygen version you are using.
For example you should no longer encounter this problem in Oxygen 11.2.
Oxygen 11.2 in the Preferences->"Editor / Format / XML" page contains a checkbox called Schema aware format and indent which is checked by default and if checked should detect that inserting a new line between the </i> and the </a> is prohibited.
Oxygen 12 will come with other XHTML pretty-print improvements like correct formatting for empty elements.
For example <br /> elements will be formatted with a space before the > but the <script></script> will be kept with the expanded form and not collapsed to <script/>.
Basically it will respect the XHTML guidelines:
http://www.w3.org/TR/xhtml1/#guidelines
So if you want to test an Oxygen 12 beta just write us an email to the support email address.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Mon Jul 05, 2010 12:37 am
Re: Pretty Print breaking XHTML formatting badly
I only have Oxygen 10.3. I did not think of this as an improvement that would require an upgrade because it seems to me that it was working in a way that I liked in an earlier version, but I do understand that things that once worked sometimes stop working. I suppose I should wait and upgrade to version 12 when it is ready. Is there a scheduled release date?
-
- Posts: 9440
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Pretty Print breaking XHTML formatting badly
Hi,
From what I know things were always like this before having Schema aware normalization.
The idea is that versions of Oxygen older than 11.2 did not look in the associated DTD/XML Schema and thus tried to detect if an element (<a href="..."> in your case) is mixed (which means that whitespaces in it are significant) by looking if it contained text other than whitespaces inside it. As in your situation the <a> only contains a child element <i> the old algorithm decided that it was element only and line breaks could be inserted after the child.
Oxygen 12 will be released at the end of August 2010.
Regards,
Radu
From what I know things were always like this before having Schema aware normalization.
The idea is that versions of Oxygen older than 11.2 did not look in the associated DTD/XML Schema and thus tried to detect if an element (<a href="..."> in your case) is mixed (which means that whitespaces in it are significant) by looking if it contained text other than whitespaces inside it. As in your situation the <a> only contains a child element <i> the old algorithm decided that it was element only and line breaks could be inserted after the child.
Oxygen 12 will be released at the end of August 2010.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Mon Jul 05, 2010 12:37 am
Re: Pretty Print breaking XHTML formatting badly
I think I had added the <a> to some list in a previous version, and that seemed to have prevented it from breaking this block -- but relying on my vague memory is a mistake, and the point is moot in this case because you clearly know far more about the details than I do (or probably ever will). And the clear answer appears to be that I should wait until August and buy the new release.
And thank you for your very prompt and very detailed answers to my very minor problem. (The product does so much beyond my relatively slight needs that I am almost embarrassed to be using it.)
And thank you for your very prompt and very detailed answers to my very minor problem. (The product does so much beyond my relatively slight needs that I am almost embarrassed to be using it.)
-
- Posts: 9440
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Pretty Print breaking XHTML formatting badly
Hi,
You probably added the element to the Space Preserve elements list in the Editor / Format / XML preferences page. Maybe the option was not imported correctly in Oxygen 10.3 and you have to re-set it.
Regards,
Radu
You probably added the element to the Space Preserve elements list in the Editor / Format / XML preferences page. Maybe the option was not imported correctly in Oxygen 10.3 and you have to re-set it.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
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