This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

A unique distinct problem


I have found a lot of info on the web, including the archive for this
list, about selecting distinct nodes using the preceding-sibling axis, and
what not.  However, I still haven't been able to find a solution for this
somewhat more convoluted problem.  Given this xml:

<report>
  <subscriber number="001930">
    <location number="358107">
      <shift_date date="09-JUL-01">
        <credit_card type="Visa">
        </credit_card>
        <credit_card type="Switch">
        </credit_card>
        <credit_card type="Mastercard">
        </credit_card>
      </shift_date>
      <shift_date date="10-JUL-01">
        <credit_card type="Visa">
        </credit_card>
      </shift_date>
    </location>
    <location number="358108">
      <shift_date date="08-JUL-01">
        <credit_card type="American Express">
        </credit_card>
        <credit_card type="Visa">
        </credit_card>
        <credit_card type="Switch">
        </credit_card>
        <credit_card type="Mastercard">
        </credit_card>
      </shift_date>
      <shift_date date="09-JUL-01">
        <credit_card type="Visa">
        </credit_card>
        <credit_card type="Mastercard">
        </credit_card>
      </shift_date>
    </location>
    <location number="358199">
      <shift_date date="08-JUL-01">
        <credit_card type="Visa">
        </credit_card>
        <credit_card type="Switch">
        </credit_card>
        <credit_card type="Mastercard">
        </credit_card>
      </shift_date>
      <shift_date date="10-JUL-01">
        <credit_card type="American Express">
        </credit_card>
        <credit_card type="Visa">
        </credit_card>
        <credit_card type="Mastercard">
        </credit_card>
      </shift_date>
    </location>
  </subscriber>
</report>

I want to iterate over a list of shift_dates and all the credit cards that
were used on that date for each subscriber.  So I want a list like this:

<shift_date date="08-JUL-01">
  <credit_card type="American Express"/>
  <credit_card type="Visa"/>
  <credit_card type="Switch"/>
  <credit_card type="Mastercard"/>
</shift_date>
<shift_date date="09-JUL-01"/>
  <credit_card type="Visa"/>
  <credit_card type="Switch"/>
  <credit_card type="Mastercard"/>
</shift_date>
<shift_date date="10-JUL-01"/>
  <credit_card type="American Express"/>
  <credit_card type="Visa"/>
  <credit_card type="Mastercard"/>
</shift_date>

So I basicly want every credit card on each date, but without duplicates
in the list.  Is this possible with XSLT 1.0?  Or should I wait for
select-distinct in XSLT 2.0?

Please cc my email, nshafer@ephibian.com, in the reply, I am not
subscribed to this list.

Thanks,
Nate




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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]