It doesn't like this line:
Code:
<!-- Handle AFv2 Pants, but do not equip pants if we already have Weather x2 and day bonuses from obi alone as obi alone hits the 35% damage cap. -->
<if Advanced='(!((regex)%Weather=^.* x2$(/regex) AND "%WeatherElement" = "%SpellElement" AND "$%SpellElementObi" = "1") OR !("%WeatherElement" = "%spellElement")) AND ("%SpellElement" = "%DayElement" AND "$BLMAF2Pants" = "1") AND ("%skill"="ElementalMagic")'>
<action type="equip" when="midcast">
<legs lock="yes">Sorcerer's Tonban</legs>
</action>
</if>