Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Multiple Groups in XSLT

From: JoelBrimm@-----------.---------.---
To: NULL
Date: 8/3/2007 12:26:00 PM

I'm trying to take a flat XML file and transform it so that it has some 
depth.  I played around trying to group witihin a group - 2 keys, nested 
for-each's... No luck.

I've looked at some newgroup listings about compound keys using concat - 
didn't really grasp it.

So, I want to take a flat XML file that looks like this:

<?xml version="1.0" encoding="utf-8"?>
<DataSet_Studio_Appt_Dates>
  <Studio_Appt_Date_Times>
    <bus_unit_id>2405</bus_unit_id>
    <sched_date>8/7/2007 12:00:00 AM</sched_date>
    <sched_day_text>Tue</sched_day_text>
    <sched_time>11:00:00</sched_time>
    <time_range_descr>Before Noon</time_range_descr>
  </Studio_Appt_Date_Times>
  <Studio_Appt_Date_Times>
    <bus_unit_id>2405</bus_unit_id>
    <sched_date>8/7/2007 12:00:00 AM</sched_date>
    <sched_day_text>Tue</sched_day_text>
    <sched_time>11:30:00</sched_time>
    <time_range_descr>Before Noon</time_range_descr>
  </Studio_Appt_Date_Times>
   <Studio_Appt_Date_Times>
    <bus_unit_id>2405</bus_unit_id>
    <sched_date>8/8/2007 12:00:00 AM</sched_date>
    <sched_day_text>Wed</sched_day_text>
    <sched_time>12:00:00</sched_time>
    <time_range_descr>Noon to 3PM</time_range_descr>
  </Studio_Appt_Date_Times>
  <Studio_Appt_Date_Times>
    <bus_unit_id>2405</bus_unit_id>
    <sched_date>8/8/2007 12:00:00 AM</sched_date>
    <sched_day_text>Wed</sched_day_text>
    <sched_time>13:00:00</sched_time>
    <time_range_descr>Noon to 3PM</time_range_descr>
  </Studio_Appt_Date_Times>
 <Studio_Appt_Date_Times>
    <bus_unit_id>2405</bus_unit_id>
    <sched_date>8/8/2007 12:00:00 AM</sched_date>
    <sched_day_text>Wed</sched_day_text>
    <sched_time>15:30:00</sched_time>
    <time_range_descr>3PM to 6PM</time_range_descr>
  </Studio_Appt_Date_Times>
  <Studio_Appt_Date_Times>
    <bus_unit_id>2405</bus_unit_id>
    <sched_date>8/8/2007 12:00:00 AM</sched_date>
    <sched_day_text>Wed</sched_day_text>
    <sched_time>16:00:00</sched_time>
    <time_range_descr>3PM to 6PM</time_range_descr>
  </Studio_Appt_Date_Times>
 </DataSet_Studio_Appt_Dates>

And group it by dates and time ranges so that it looks like this:

<Studio_Appt_Data>
  <bus_unit_id>2405</bus_unit_id>
    <Studio_Appt_Dates>
      <Studio_Appt_Date>8/7/2007 12:00:00 AM</Studio_Appt_Date>
      <Time_Ranges>
        <Time_Range>
          <time_range_str>Before Noon</time_range_str>
          <appt_times>			
            <appt_time>11:00</appt_time>
            <appt_time>11:30</appt_time>			
          </appt_times>
        </Time_Range>
    </Studio_Appt_Dates>
      <Studio_Appt_Date>8/8/2007 12:00:00 AM</Studio_Appt_Date>
      <Time_Ranges>
        <Time_Range>
          <time_range_str>Noon to 3PM</time_range_str>
          <appt_times>			
            <appt_time>12:00</appt_time>
            <appt_time>13:00</appt_time>			
          </appt_times>
        </Time_Range>
        <Time_Range>
          <time_range_str>3PM to 6PM</time_range_str>
          <appt_times>			
            <appt_time>15:30</appt_time>
            <appt_time>16:00</appt_time>			
          </appt_times>
        </Time_Range>
    </Studio_Appt_Dates>

Thanks!

Joel Brimm.


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent