Attention:

Welcome to the old forum. While it is no longer updated, there is a wealth of information here that you may search and learn from.

To partake in the current forum discussion, please visit https://forums.presonus.com

Indentation

Indentation

Postby wcreed51 » Thu Aug 29, 2013 1:08 pm

Having worked for years in VBA the lack of indentation in XML seems odd to me.

Is there any reason not to write things like this?
Attachments
Ind.jpg
Ind.jpg (49.17 KiB) Viewed 6388 times
Bill Reed
Notion 4, Sibelius 7.5, Finale 2011/14, Overture 4, Cubase 7.5
Win8 x64, 32GB RAM
M-Audio ProFire 2626
Kontakt, VSL VI Pro, VE Pro, EWQL Orch, Choirs and Pianos
User avatar
wcreed51
 
Posts: 754
Joined: Wed Oct 07, 2009 10:50 am
Location: Berkshires, MA USA

Re: Indentation

Postby dcd111 » Thu Aug 29, 2013 1:26 pm

As far as I can tell, you can use as many levels of indentation as you like, it doesn't affect anything. I use it in my rules, and as far as I can tell, so do most of Notion's own plugin rules.

I know different text readers will display indentation differently, though. With Notepad++ it works very well, but Notepad makes a mess of it.
dcd111
 
Posts: 73
Joined: Wed Jun 06, 2012 6:07 pm

Re: Indentation

Postby wcreed51 » Thu Aug 29, 2013 1:29 pm

OK. I'm using Notepad2, but maybe I should try something different.
Bill Reed
Notion 4, Sibelius 7.5, Finale 2011/14, Overture 4, Cubase 7.5
Win8 x64, 32GB RAM
M-Audio ProFire 2626
Kontakt, VSL VI Pro, VE Pro, EWQL Orch, Choirs and Pianos
User avatar
wcreed51
 
Posts: 754
Joined: Wed Oct 07, 2009 10:50 am
Location: Berkshires, MA USA

Re: Indentation

Postby pcartwright » Thu Aug 29, 2013 7:27 pm

I don't use indentation as much simply because there aren't else or else-if statements within the rules. Each rule is usually one if statement after another (as is your example), so it becomes a little redundant to indent IMHO, but I know this isn't really the norm.

Also, +1 to Notepad++
pcartwright
 
Posts: 796
Joined: Sat Dec 05, 2009 2:47 pm

Re: Indentation

Postby dcd111 » Thu Aug 29, 2013 8:05 pm

So far, I've found the best system for me is to indent <rule> and </rule> to the same level, then the <if /> statements to the next level, and then the modification statements to a third level, like this:

Code: Select all
      <rule name="implement straight mute, velo key">
         <if flag="stra" />
         <if not-flag="vfad" />
         <if not-flag="afad" />
            <channel-change channel="6" />
            <cc controller="21" value="6" type="note-on-prefix" />
      </rule>
dcd111
 
Posts: 73
Joined: Wed Jun 06, 2012 6:07 pm


Return to Custom Rules Discussion

Who is online

Users browsing this forum: No registered users and 0 guests