Page 1 of 1

Insert line breaks before processing instruction

Posted: Thu Jan 16, 2020 7:43 pm
by HVV
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

Re: Insert line breaks before processing instruction

Posted: Mon Jan 20, 2020 3:34 pm
by adrian
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

Re: Insert line breaks before processing instruction

Posted: Mon Jan 27, 2020 4:44 pm
by HVV
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