[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] things about grouping

Subject: Re: [xsl] things about grouping
From: Ihe Onwuka <ihe.onwuka@xxxxxxxxx>
Date: Thu, 29 Nov 2012 11:35:22 +0000

On Thu, Nov 29, 2012 at 10:12 AM, Graydon <graydon@xxxxxxxxx> wrote:
> On Thu, Nov 29, 2012 at 05:58:45AM +0000, Ihe Onwuka scripsit:
>> > Since we're talking about "except" and language definitions, has anyone
>> > ever proposed a different form (or is there a different form for) the
>> > construct:
>> >
>> > div[not(* except (heading,para))]
>> >
>> > It's really useful, but I find it frequently brain-melting, especially
>> > as a component of more complex expressions.
>> A problem here is the mixture of notation from mathematical (set
>> theoretic in the form of except) and non-mathematical (the comma
>> operator).
> [snip]
>> Now (get ready for the leap of faith and giant hand wave), substitute
>> the comma operator back for the | and you have div[(heading,para]
> All the divs who have heading or para children, yes, but that's not
> quite the same thing.
> Unless I'm unusually addled this morning,
> div[not(* except (heading,para))]
> is a div which has _only_ heading or para children

Well the problem is with the semantic effect of div [ ] not the set
theoretical translation of the predicate.

Returning to my earlier notation  take the complement of what we ended up with


Only - would be things that are not in the above expression - we are
in to double negative territory.

div[not(heading|para)']   (that should bother you - well it does me)

but you could do a mechanical DeMorgan translation to turn that into
something that keeps the computer happy

div[(not ((* except heading ) union (* except para))]

 while you mentally continue to parse it as  div[not(heading|para)']

Current Thread