Re: [Xsltforms-support] hiding/displaying groups
Brought to you by:
alain-couthures
From: C. M. Sperberg-M. <cm...@bl...> - 2012-07-10 19:55:30
|
On Jul 10, 2012, at 5:01 AM, Alain Couthures wrote: > Hello Jens, >> I have groups for hiding/displaying a set of buttons for inserting missing elements and attributes. They are at times monstrously long, such as, >> >> <xf:group class="show-hide" ref=".[not(@altRepGroup)] | .[not(@authority)] | .[not(@authorityURI)] | .[not(@displayLabel)] | .[not(@ID)] | .[not(@lang)] | .[not(@nameTitleGroup)] | .[not(mods:nonSort)] | .[not(mods:partName)] | .[not(mods:partNumber)] | .[not(@script)] | .[not(mods:subTitle)] | .[not(@supplied)] | .[not(mods:title)] | .[not(@transliteration)] | .[not(@type)] | .[not(@usage)] | .[not(@valueURI)] | .[not(@xml:lang)] | .[not(@xlink:href)]"> > First, I would try to minimize such expressions like this, if there is > one char that should not appear in values: > .[not(contains(concat('~',@altRepGroup,'~',@authority,'~',@authorityURI,'~',@displayLabel,'~',@ID,'~',@lang,'~',@nameTitleGroup,'~',.....,'~'),'~~'))] For the case where we don't have any guarantees about the values (so concatenating with '~' or any other magic character is not safe), I wonder (just thinking out loud here) if applying DeMorgan's Law to produce a simpler expression would help: ref=".[not(@altRepGroup and @authority and @authorityURI and ... ... and @xlink:href)]" Or even (if your list is all the attributes that are possible, which is alas probably not the case) ref=".[count(@*) < 20]" Not tested. Michael -- **************************************************************** * C. M. Sperberg-McQueen, Black Mesa Technologies LLC * http://www.blackmesatech.com * http://cmsmcq.com/mib * http://balisage.net **************************************************************** |