Hello Michael,

Thank you for laying out the law!

Both your rewritings work fine. I wonder which one is the fastest?

Regards,

Jens

On Jul 10, 2012, at 9:55 PM, C. M. Sperberg-McQueen wrote:

> 
> 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)]"
> 

<xf:group class="show-hide" ref=".[not(mods:partName and mods:partNumber and 
@script and mods:subTitle and @supplied and mods:title and @transliteration and 
@type and @usage and @valueURI and @xml:lang and @xlink:href)]">

> Or even (if your list is all the attributes that are possible, which is 
> alas probably not the case)
> 
>  ref=".[count(@*) &lt; 20]"
> 
> Not tested.

<xf:group class="show-hide" ref=".[count(@*) &lt; 8 or count(*) &lt; 5]">

> 
> 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

Reply via email to