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

[xsl] Muenchian Grouping with Position() Constraints


Subject: [xsl] Muenchian Grouping with Position() Constraints
From: "McDonald, Thomas" <Thomas.McDonald@xxxxxxxxxxxxxx>
Date: Fri, 13 Jun 2003 09:56:19 -0400

Hi,

I am doing some Muenching grouping and in the result I want to constrain the
output, i.e., I don't want to show anything that matches the first three key
values.

For example, imagine you were making a phone book from the following xml and
you wanted to not show the first three names in the key (I assume the key is
kept in document order so I want to eliminate all names that are Aarron,
Aiken or Appleby).

<names>
<name><lname>Aarron</lname><first>Hank</first><name>
<name><lname>Aarron</lname><first>Ted</first><lname>
<name><lname>Aiken</lname><first>Joe</first></name>
<name><lname>Aiken</lname><first>Jill</first></name>
<name><lname>Appleby</lname><first>Joe</first></name>
<name><lname>Appleby</lname><first>Sarah</first></name>
<name><lname>Appleseed</lname><first>John</first></name>
<name><lname>Appleseed</lname><first>Susan</first></name>
<name><lname>Arson</lname><first>Joe</first></name>
<name><lname>Arson<lname><first>Bill</first></name>
<name><lname>Azzure<lname><first>Peg</first></name>
</names>

Consequently the result tree should look like 

<names>
<name>
<lname>Appleseed</lname>
<first>
 <fname>John</fname>
 <fname>Susan</fname>
</first>
</name>
<name>
<lname>Arson</lname>
<first>
 <fname>Joe</fname>
 <fname>Bill</fname>
</first>
</name>
<name>
<lname>Azzure</lname>
<first>
 <fname>Peg</fname>
</first>
</name>
</names>

Notice that the top three names from the document didn't appear in the
result tree.  


Regards,

Tom

fyi, if you want to know why I would do such a thing, just imagine that I am
selling phone books and people who pay get the WHOLE phone book, including
the first three names of every letter.  People who don't pay get the PARTIAL
phone book (excluding the first three people from every letter) until they
pay.  Muuuhuuuuhahahahahahahah!  Also, I must constrain by position in the
document so please don't offer a suggestion based on alphabetizing or some
other system.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords
xml