Wrapping that preserves indentation
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 3
- Joined: Sun Apr 23, 2017 8:49 am
Wrapping that preserves indentation
Post by carymilsap »
I'd like to be able to have XML that looks like this, without having to manually break lines:
But what I get with everything I've tried with <oXygen/>'s preferences displays like this when it wraps:
Is there any way to make automatic wrapping indent to the same level as the first line?
Code: Select all
<xsl:choose>
<xsl:when test="$whatever">
<p>
Pretend that this is a long paragraph (there's no newline here)
that has to wrap.
</p>
</xsl:when>
</xsl:choose>
Code: Select all
<xsl:choose>
<xsl:when test="$whatever">
<p>
Pretend that this is a long paragraph (there's no newline here)
that has to wrap.
</p>
</xsl:when>
</xsl:choose>
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Wrapping that preserves indentation
Hello,
As for hard line wrapping, it is possible to configure Oxygen to format the document that way (Format and Indent), but note that it implies modifying the content (inserting the line break and indent in the XML content).
Regards,
Adrian
The Line wrap option from Options > Preferences, Editor / Edit Modes / Text is a "soft" line wrap, which means it wraps the text on multiple lines only visually. It does not touch the content and it does not indent the wrapped text. It's not possible to obtain indented soft line wrapped text in Oxygen.carymilsap wrote: ↑Thu Jan 09, 2020 2:01 amIs there any way to make automatic wrapping indent to the same level as the first line?
As for hard line wrapping, it is possible to configure Oxygen to format the document that way (Format and Indent), but note that it implies modifying the content (inserting the line break and indent in the XML content).
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 3
- Joined: Sun Apr 23, 2017 8:49 am
Re: Wrapping that preserves indentation
Post by carymilsap »
I was afraid of that. Soft line wrapping that honors the indent level when displayed by Oxygen is exactly what I'm looking for.
I don't mind changing the content by inserting line breaks. That's what I'm doing now. But unfortunately, Oxygen's Format and Indent feature doesn't help me because even when I don't select the surrounding element tokens, the formatter includes them in the formatted result, which messes up the way my XSLT code looks:
It's not so bad in this example, when the element is a simple <p>, but it's unacceptable when the element that's integrated into the text is something more complicated like <xsl:when ...>.
So I have to insert line breaks by hand, which is intensely tedious. It diminishes the experience of using Oxygen, for sure.
I don't mind changing the content by inserting line breaks. That's what I'm doing now. But unfortunately, Oxygen's Format and Indent feature doesn't help me because even when I don't select the surrounding element tokens, the formatter includes them in the formatted result, which messes up the way my XSLT code looks:
Code: Select all
<xsl:choose>
<xsl:when test="$whatever">
<p> Pretend that this is a long paragraph (there's no newline here)
that has to wrap. </p>
</xsl:when>
</xsl:choose>
So I have to insert line breaks by hand, which is intensely tedious. It diminishes the experience of using Oxygen, for sure.
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Wrapping that preserves indentation
The formatter works at element level, you can't format just the text from within the p element, you can only format the p element itself.carymilsap wrote: ↑Thu Jan 09, 2020 6:29 pmBut unfortunately, Oxygen's Format and Indent feature doesn't help me because even when I don't select the surrounding element tokens, the formatter includes them in the formatted result, which messes up the way my XSLT code looks:
If you want to format only the current element or selection, use contextual menu > Source > Format and Indent Element / Ctrl+Shift+I/Cmd+Shift+I.
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
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