Subject:Transforming XML to XML - grouping Author:Brad Moore Date:29 Nov 2007 12:40 PM
I've been working on this for two days and have now successfully pulled out all my hair... I could use some help.... I am building an Access database that needs to export personnel scheduling information to XML, so it can be imported into another program. I know Access, however, much to my frustration, don't know XML. My output format looks like this....
etc..... Again with one <SHIFT> entry for each day of the year and one <USER> entry for each employee. I can get the transformation to look this way when I export one user from the database, but when I have more than one user, I can't get it to start a new <USER> at the end of the year (i.e - <SHIFT DATE="31/12/07"... for user "SMITH" is immediately followed by <SHIFT DATE="01/01/07".... for user "JONES" with no <USER> tag)....
This is the XSL I have generated with Stylus Studio
Subject:Transforming XML to XML - grouping Author:Alberto Massari Date:30 Nov 2007 05:15 AM
you need to place the code between <USER> and </USER> inside a loop, that is executed once for every user you have in the exported data.
Have a look at the grouping technique described at http://www.jenitennison.com/xslt/grouping/muenchian.html to see how this can be done.