Insert line breaks before processing instruction

<oXygen/> general issues.
HVV
Posts: 16
Joined: Fri Dec 02, 2016 4:02 pm

Insert line breaks before processing instruction

Post by HVV » Thu Jan 16, 2020 7:43 pm

Hi,

I would like to insert a line break before each processing instruction when using the 'format and indent' option. Is this possible?

For instance my document starts as follows:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?><?xml-model href="file:/T:/Schemas/dtbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?><?xml-model href="file:/T:/Schemas/dtbook-2005-3.dtd"?>
And I would like it to be like this after i hit Ctrl+Shift+P:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="file:/T:/Schemas/dtbook.sch" type="application/xml" schematypens="http://purl.oclc.org/dsdl/schematron"?>
<?xml-model href="file:/T:/Schemas/dtbook-2005-3.dtd"?>
I suspect this is possible to configure in the preferences under "Editor/ Format / XML", but I can't figure it out. Can somebody help me with this?

Kind regards,

Hugo

adrian
Posts: 2666
Joined: Tue May 17, 2005 4:01 pm

Re: Insert line breaks before processing instruction

Post by adrian » Mon Jan 20, 2020 3:34 pm

Hello,

Unfortunately that's not possible as of v21.1. The "Elements spacing" options are, as the title hints, for elements only. Only a simplified form of XPath can be used in these rules and it must indicate elements.
Editor > Format > XML Preferences, Element Spacing Section

Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

HVV
Posts: 16
Joined: Fri Dec 02, 2016 4:02 pm

Re: Insert line breaks before processing instruction

Post by HVV » Mon Jan 27, 2020 4:44 pm

Hi Adrian,

Thanks for the explanation, I won't look further into this option then.

My purpose was to improve the human readabilty of xml files that contain multiple processing instructions. Maybe I'll look further in the direction of XSL to solve this then.

Kind regards,

Hugo

Post Reply