Question about Format and Indent
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 106
- Joined: Wed Dec 18, 2013 3:07 am
Question about Format and Indent
Hello,
We have some (DITA) files which have nested <ul>s.
We want to display them as they are, which is like this:
But oXygen's Format and Indent moves the second <ul> up onto the end of the previous line and inserts a space, like this:
Is it possible to either modify Format and Indent so that the former layout is preserved or at least prevent that space being inserted?
(We have problems with formatting generally because we have files created in different editors. We're trying to come up with a single formatting that will be (relatively) easy to maintain whatever the file is edited in.)
I've tried fiddling around with the format settings, but so far, without success.
Cheers,
Eddie.
We have some (DITA) files which have nested <ul>s.
We want to display them as they are, which is like this:
Code: Select all
<ul>
<li>List 1, Item 1.
<ul>
<li>List 2, Item 1.</li>
<li>List 2, Item 2.</li>
</ul>
</li>
<li>List 1, Item 2.</li>
Code: Select all
<ul>
<li>List 1, Item 1. <ul>
<li>List 2, Item 1.</li>
<li>List 2, Item 1.</li>
</ul> </li>
<li>List 1, Item 2.</li>
(We have problems with formatting generally because we have files created in different editors. We're trying to come up with a single formatting that will be (relatively) easy to maintain whatever the file is edited in.)
I've tried fiddling around with the format settings, but so far, without success.
Cheers,
Eddie.
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Question about Format and Indent
Hi Eddie,
In the Preferences->Editor / Format / XML page there is an Indent inline elements checkbox which by default is checked. You probably unchecked it in your side, which leads to the behavior you mentioned.
In this particular case Oxygen considers based on the DITA DTDs that the <li> element has mixed content (allows both text content and tags) and thus considers the <ul> an inline tag inside it.
Whenever in an inline context if Oxygen finds spaces (or line breaks) between elements (like the space between the end </ul> and the end </li>) it will never remove them completely because it considers that at least one space must remain there, considering the space significant in mixed content.
Regards,
Radu
In the Preferences->Editor / Format / XML page there is an Indent inline elements checkbox which by default is checked. You probably unchecked it in your side, which leads to the behavior you mentioned.
In this particular case Oxygen considers based on the DITA DTDs that the <li> element has mixed content (allows both text content and tags) and thus considers the <ul> an inline tag inside it.
Whenever in an inline context if Oxygen finds spaces (or line breaks) between elements (like the space between the end </ul> and the end </li>) it will never remove them completely because it considers that at least one space must remain there, considering the space significant in mixed content.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 106
- Joined: Wed Dec 18, 2013 3:07 am
Re: Question about Format and Indent
Hello Radu,
Thanks for the reply.
You're right, I have tried this with "Indent Inline Settings" cleared.
Just to be sure, can you confirm that the following is the correct behaviour?
Cheers,
Eddie.
Original. (Ideally, we'd like it to stay this way after formatting.)
Ctrl+Shift+P with "Indent Inline Settings" checked.
Ctrl+Shift+P with "Indent Inline Settings" cleared.
Thanks for the reply.
You're right, I have tried this with "Indent Inline Settings" cleared.
Just to be sure, can you confirm that the following is the correct behaviour?
Cheers,
Eddie.
Original. (Ideally, we'd like it to stay this way after formatting.)
Code: Select all
<ul>
<li>List 1, Item 1.
<ul>
<li>List 2, Item 1.</li>
<li>List 2, Item 1.</li>
</ul>
</li>
<li>List 1, Item 2.</li>
</ul>
Code: Select all
<ul>
<li>List 1, Item 1. <ul>
<li>List 2, Item 1.</li>
<li>List 2, Item 1.</li>
</ul>
</li>
<li>List 1, Item 2.</li>
</ul>
Code: Select all
<ul>
<li>List 1, Item 1. <ul>
<li>List 2, Item 1.</li>
<li>List 2, Item 1.</li>
</ul> </li>
<li>List 1, Item 2.</li>
</ul>
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Question about Format and Indent
Hi Eddie,
Right, exactly, it's also explained in our user's manual:
http://www.oxygenxml.com/doc/ug-editor/ ... t-xml.html
Regards,
Radu
Right, exactly, it's also explained in our user's manual:
http://www.oxygenxml.com/doc/ug-editor/ ... t-xml.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Return to “General XML Questions”
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