Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Questions about XML that are not covered by the other forums should go here.
-
- Posts: 7
- Joined: Wed Apr 28, 2021 10:41 pm
Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
I have a problem with the Format and Indent Files (Pretty-Print) tool.
Specifically: After using the tool, my XML file automatically generated a blank line at the end of the file. The long lines are all truncated to multiple lines (quite difficult to read). All spacing (tabs, spacing) are replaced with spaces.
So I want to ask: How to disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Specifically: After using the tool, my XML file automatically generated a blank line at the end of the file. The long lines are all truncated to multiple lines (quite difficult to read). All spacing (tabs, spacing) are replaced with spaces.
So I want to ask: How to disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Hello,
Thanks for your feedback.
You can control the formatting opinions from "Options->Preferences-> Editor / Format" options page.
The number of characters after which the Format and Indent (pretty-print) action performs hard line-wrapping, is by default 100. You can set a different value from the "Line width" option. You can also enable "Detect line width on open" option, and Oxygen will automatically detect the line width when the document is opened. This is useful when you have multiple long lines, if just some of the lines are long, you must manually set a value in the "Line width" option.
If your document is indented with tabs, please make sure that the option "Detect indent on open" is selected (by default is selected). If this option is selected Oxygen will detect when TAB characters are used to indent content, and the size of the TAB characters is used for the indent size.
You can also force a document to be indented with tabs by selecting "Indent with tabs." option.
Unfortunately, the the new line added at the end of document cannot be controlled. The Format and Indent action always adds a new line, if there is not already a new line there.
You can find more details about formatting options in our user manual:
https://www.oxygenxml.com/doc/versions/ ... ormat.html
Best Regards,
Octavian
Thanks for your feedback.
You can control the formatting opinions from "Options->Preferences-> Editor / Format" options page.
The number of characters after which the Format and Indent (pretty-print) action performs hard line-wrapping, is by default 100. You can set a different value from the "Line width" option. You can also enable "Detect line width on open" option, and Oxygen will automatically detect the line width when the document is opened. This is useful when you have multiple long lines, if just some of the lines are long, you must manually set a value in the "Line width" option.
If your document is indented with tabs, please make sure that the option "Detect indent on open" is selected (by default is selected). If this option is selected Oxygen will detect when TAB characters are used to indent content, and the size of the TAB characters is used for the indent size.
You can also force a document to be indented with tabs by selecting "Indent with tabs." option.
Unfortunately, the the new line added at the end of document cannot be controlled. The Format and Indent action always adds a new line, if there is not already a new line there.
You can find more details about formatting options in our user manual:
https://www.oxygenxml.com/doc/versions/ ... ormat.html
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Wed Apr 28, 2021 10:41 pm
Re: Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Hello,tavy wrote: ↑Thu Apr 29, 2021 12:30 pm Hello,
Thanks for your feedback.
You can control the formatting opinions from "Options->Preferences-> Editor / Format" options page.
The number of characters after which the Format and Indent (pretty-print) action performs hard line-wrapping, is by default 100. You can set a different value from the "Line width" option. You can also enable "Detect line width on open" option, and Oxygen will automatically detect the line width when the document is opened. This is useful when you have multiple long lines, if just some of the lines are long, you must manually set a value in the "Line width" option.
If your document is indented with tabs, please make sure that the option "Detect indent on open" is selected (by default is selected). If this option is selected Oxygen will detect when TAB characters are used to indent content, and the size of the TAB characters is used for the indent size.
You can also force a document to be indented with tabs by selecting "Indent with tabs." option.
Unfortunately, the the new line added at the end of document cannot be controlled. The Format and Indent action always adds a new line, if there is not already a new line there.
You can find more details about formatting options in our user manual:
https://www.oxygenxml.com/doc/versions/ ... ormat.html
Best Regards,
Octavian
How do I customize the end of lines (Windows, Unix, ...) of the file?
My problem is that the tool replaced all spaces (tabs, spaces) of the value in the XML tag with spaces. For example:
Before formatting:
Code: Select all
<ms0> 1 # 340028 # 5 </ms0> <ms1> 1500 # 340028 # 150 </ms1>
Code: Select all
<ms0> 1 # 340028 # 5 </ms0>
<ms1> 1500 # 340028 # 150 </ms1>
Code: Select all
<ms0> 1 # 340028 # 5 </ms0>
<ms1> 1500 # 340028 # 150 </ms1>
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Hello,
I think you can use the "Preserve text as it is" option from Options->Preferences->Editor / Format / XML option page. If is selected, the Format and Indent operation preserves text content as it is, without removing or adding any white space.
Another solution is to add the elements, that you want to preserve the spacing for, in the "Element Spacing Section". This section controls how the application handles whitespaces found in XML content. You can Add or Remove element names or simplified XPath expressions in the various tabs.
Best Regards,
Octavian
I think you can use the "Preserve text as it is" option from Options->Preferences->Editor / Format / XML option page. If is selected, the Format and Indent operation preserves text content as it is, without removing or adding any white space.
Another solution is to add the elements, that you want to preserve the spacing for, in the "Element Spacing Section". This section controls how the application handles whitespaces found in XML content. You can Add or Remove element names or simplified XPath expressions in the various tabs.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 7
- Joined: Wed Apr 28, 2021 10:41 pm
Re: Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
OK, thank you so much.tavy wrote: ↑Tue May 04, 2021 8:59 am Hello,
I think you can use the "Preserve text as it is" option from Options->Preferences->Editor / Format / XML option page. If is selected, the Format and Indent operation preserves text content as it is, without removing or adding any white space.
Another solution is to add the elements, that you want to preserve the spacing for, in the "Element Spacing Section". This section controls how the application handles whitespaces found in XML content. You can Add or Remove element names or simplified XPath expressions in the various tabs.
Best Regards,
Octavian
-
- Posts: 1
- Joined: Mon Dec 02, 2024 10:17 am
Re: Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Some editors support plugins to manage formatting preferences better. For example, Prettier for VS Code has extensive formatting options.
Incredibox
Incredibox
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Disable adding newline at the end of file and auto line break when long line? Keep the original type of spacing?
Hello,
Thank you for the feedback.
We will explore other formatting options. It might be possible to add similar support in Oxygen XML Editor through a plugin, or perhaps someone could develop a plugin for Oxygen.
Best Regards,
Octavian
Thank you for the feedback.
We will explore other formatting options. It might be possible to add similar support in Oxygen XML Editor through a plugin, or perhaps someone could develop a plugin for Oxygen.
Best Regards,
Octavian
Octavian Nadolu
<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