Unwrapping element inserts extra spaces
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 24
- Joined: Fri May 13, 2016 5:34 pm
Unwrapping element inserts extra spaces
Hi,
I am trying to remove unnecessary <p> elements inside <li>, <entry>, etc. I have found the following happens for this example:
Thank you.
Best regards,
Ozana
I am trying to remove unnecessary <p> elements inside <li>, <entry>, etc. I have found the following happens for this example:
Code: Select all
<ul>
<li><p>something</p></li>
<li>
<p>else</p>
</li>
</ul>
- In Text mode, using either Refactoring>Delete Element Tags (Alt+Shift+X) or Refactoring>Elements>Unwrap element with target element "li/p", the result will be:
This results in extra space before and after "else", which is not equivalent with the original. With Format and Indent we can see the extra spaces:
Code: Select all
<ul> <li>something</li> <li> else </li> </ul>
Code: Select all
<ul> <li>something</li> <li> else </li> </ul>
- Looking at the same example in Author mode, Refactoring>Elements>Unwrap element with target element "li/p" gives the same result:
Code: Select all
<ul> <li>something</li> <li> else </li> </ul>
- However, using Refactoring>Delete Element Tags (Alt+Shift+X) in Author mode does what I expect it to do and the result is:
Code: Select all
<ul> <li>something</li> <li>else</li> </ul>
Thank you.
Best regards,
Ozana
-
- Posts: 419
- Joined: Mon May 09, 2016 9:37 am
Re: Unwrapping element inserts extra spaces
Post by sorin_carbunaru »
Hello Ozana,
I can't say the behavior you mentioned as unwanted for you is a bug. For XML Refactoring, it's just the way the script is working with the XML text. And actually, when the paragraph is on a new line, there are quite a lot of spaces before and after it...
Regarding the Delete Element Tags in the Author page, it is just implemented differently, and it works with Author-page-related structures and information, which is more than the information we have with plain XML text.
Kind regards,
Sorin Carbunaru
oXygen XML
I can't say the behavior you mentioned as unwanted for you is a bug. For XML Refactoring, it's just the way the script is working with the XML text. And actually, when the paragraph is on a new line, there are quite a lot of spaces before and after it...
Regarding the Delete Element Tags in the Author page, it is just implemented differently, and it works with Author-page-related structures and information, which is more than the information we have with plain XML text.
Kind regards,
Sorin Carbunaru
oXygen XML
-
- Posts: 24
- Joined: Fri May 13, 2016 5:34 pm
Re: Unwrapping element inserts extra spaces
Hello,
Thanks for your reply.
I tried switching on/off different options in Preference > Editor > XML to try to get from this:
to this:
when doing format+indent, so that I can then use the unwrap.
The only thing I managed to get is this:
which has the extra spaces and will mess up the spacing in the published output if I do the unwrap.
Is there any option I have missed, or any steps I can follow to get what I need?
If not, is it possible to add an option in a future version of oXygen Editor? It's too much manual work as it is now.
Thank you.
Best regards,
Ozana
Thanks for your reply.
I tried switching on/off different options in Preference > Editor > XML to try to get from this:
Code: Select all
<li>
<p>else</p>
</li>
Code: Select all
<li><p>else</p></li>
The only thing I managed to get is this:
Code: Select all
<li> <p>else</p> </li>
Is there any option I have missed, or any steps I can follow to get what I need?
If not, is it possible to add an option in a future version of oXygen Editor? It's too much manual work as it is now.
Thank you.
Best regards,
Ozana
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Unwrapping element inserts extra spaces
Post by chrispitude »
It seems like the text-mode unwrap operation should be enhanced to be schema-aware so it knows which elements are space-preserved and which are not.
-
- Posts: 419
- Joined: Mon May 09, 2016 9:37 am
Re: Unwrapping element inserts extra spaces
Post by sorin_carbunaru »
Hello,
Ozana, I am afraid there is no format & indent option for this. I created an improvement request for this (EXM-44839 - for reference purposes).
Chris, thank you for your intervention! I also created an issue to investigate what could be done at the XML refactoring operation level (EXM-44840).
All the best wishes,
Sorin C.
Ozana, I am afraid there is no format & indent option for this. I created an improvement request for this (EXM-44839 - for reference purposes).
Chris, thank you for your intervention! I also created an issue to investigate what could be done at the XML refactoring operation level (EXM-44840).
All the best wishes,
Sorin C.
-
- Posts: 922
- Joined: Thu May 02, 2019 2:32 pm
Re: Unwrapping element inserts extra spaces
Post by chrispitude »
Hi Sorin,
It was Radu that taught me about schema-awareness when we ran into a similar issue with extra blank lines showing up in the editor due to this effect.
It was Radu that taught me about schema-awareness when we ran into a similar issue with extra blank lines showing up in the editor due to this effect.

Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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