A little question about XML/XSL.
I have the following XML:
<Employees>
<Employee> <ID>1</ID> <WeekID>1</WeekID> <DayID>1</DayID> <Hours>5</Hours> </Employee>
<Employee> <ID>1</ID> <WeekID>1</WeekID> <DayID>1</DayID> <Hours>4</Hours> </Employee>
<Employee> <ID>1</ID> <WeekID>1</WeekID> <DayID>2</DayID> <Hours>7</Hours> </Employee>
<Employee> <ID>1</ID> <WeekID>2</WeekID> <DayID>1</DayID> <Hours>5</Hours> </Employee>
<Employee> <ID>1</ID> <WeekID>2</WeekID> <DayID>3</DayID> <Hours>8</Hours> </Employee>
<Employee> <ID>2</ID> <WeekID>1</WeekID> <DayID>1</DayID> <Hours>5</Hours> </Employee>
<Employee> <ID>2</ID> <WeekID>2</WeekID> <DayID>4</DayID> <Hours>4</Hours> </Employee>
</Employees>
I want to hierarchize this XML like this:
<Employees>
<Employee>
<ID>1</ID>
<Weeks>
<Week>
<WeekID>1</WeekID>
<Days>
<Day>
<DayID>1</DayID>
<Hours>5</Hours>
<Hours>4</Hours>
</Day>
<Day>
<DayID>2</DayID>
<Hours>7</Hours>
</Day>
</Days>
</Week>
<Week>
<WeekID>2</WeekID>
<Days>
<Day>
<DayID>1</DayID>
<Hours>5</Hours>
</Day>
<Day>
<DayID>3</DayID>
<Hours>8</Hours>
</Day>
</Days>
</Week>
</Weeks>
</Employee>
<Employee>
<ID>2</ID>
<Weeks>
<Week>
<WeekID>1</WeekID>
<Days>
<Day>
<DayID>1</DayID>
<Hours>5</Hours>
</Day>
</Days>
</Week>
<Week>
<WeekID>2</WeekID>
<Days>
<Day>
<DayID>4</DayID>
<Hours>4</Hours>
</Day>
</Days>
</Week>
</Weeks>
</Employee>
</Employees>
Is this possible ? If so, what would be the XSL transformation to apply (with XSLT 1.0 only) ?
Thanks, Florent
Drinking coffee prevents you from sleeping. On the other hand, sleeping prevents you from drinking coffee.