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
****************************************************************
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Xsltforms-support mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xsltforms-support