Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
--TEST--
2
XML_Query2XML::getXML(): Case08
3
--SKIPIF--
4
<?php
5
require_once dirname(dirname(__FILE__)) . '/skipif.php';
6
if (!@include_once 'I18N/UnicodeString.php') {
7
    print 'skip could not find I18N/UnicodeString.php';
8
    exit;
9
}
10
if (strpos(DSN, 'sqlite') === 0 && strpos(DSN, 'sqlite3') !== 0) {
11
    echo 'skip sqlite before v3.1 does not support backreferences to fields in parent table - see http://www.sqlite.org/cvstrac/wiki?p=UnsupportedSql';
12
    exit;
13
}
14
?>
15
--FILE--
16
<?php
17
class Mappers
18
{
19
    public static function departmentMapper($str)
20
    {
21
        //maps 'one_two_three' to 'oneTwoThree'
22
        return preg_replace("/(_)([a-z])/e", "strtoupper('\\2')", $str);
23
    }
24
 
25
    public static function employeeMapper($str)
26
    {
27
        //maps 'one_two_three' to 'OneTwoThree'
28
        return ucfirst(preg_replace("/(_)([a-z])/e", "strtoupper('\\2')", $str));
29
    }
30
 
31
    public function saleMapper($str)
32
    {
33
        //maps 'one_two_three' to 'ONETWOTHREE'
34
        return strtoupper(str_replace('_', '', $str));
35
    }
36
}
37
 
38
function mapArtist($str)
39
{
40
    //maps 'one_two_three' to 'onetwothree'
41
    return strtolower(str_replace('_', '', $str));
42
}
43
 
44
$myMappers = new Mappers();
45
 
46
require_once 'XML/Query2XML.php';
47
require_once 'XML/Query2XML/ISO9075Mapper.php';
48
require_once dirname(dirname(__FILE__)) . '/db_init.php';
49
$query2xml = XML_Query2XML::factory($db);
50
$dom = $query2xml->getXML(
51
    "SELECT
52
         s.*,
53
         manager.employeeid AS manager_employeeid,
54
         manager.employeename AS manager_employeename,
55
         d.*,
56
         department_head.employeeid AS department_head_employeeid,
57
         department_head.employeename AS department_head_employeename,
58
         e.*,
59
         sa.*,
60
         c.*,
61
         al.*,
62
         ar.*,
63
         (SELECT COUNT(*) FROM sale WHERE sale.store_id = s.storeid) AS store_sales,
64
         (SELECT
65
            COUNT(*)
66
          FROM
67
            sale, employee, employee_department
68
          WHERE
69
            sale.employee_id = employee.employeeid
70
            AND
71
            employee_department.employee_id = employee.employeeid
72
            AND
73
            employee_department.department_id = d.departmentid
74
         ) AS department_sales,
75
         (SELECT
76
            COUNT(*)
77
          FROM
78
            employee, employee_department, department
79
          WHERE
80
            employee_department.employee_id = employee.employeeid
81
            AND
82
            employee_department.department_id = department.departmentid
83
            AND
84
            department.store_id = s.storeid
85
         ) AS store_employees,
86
         (SELECT
87
            COUNT(*)
88
          FROM
89
            employee, employee_department
90
          WHERE
91
            employee_department.employee_id = employee.employeeid
92
            AND
93
            employee_department.department_id = d.departmentid
94
         ) AS department_employees
95
     FROM
96
         store s
97
          LEFT JOIN employee manager ON s.manager = manager.employeeid
98
         LEFT JOIN department d ON d.store_id = s.storeid
99
          LEFT JOIN employee department_head ON department_head.employeeid = d.department_head
100
          LEFT JOIN employee_department ed ON ed.department_id = d.departmentid
101
           LEFT JOIN employee e ON e.employeeid = ed.employee_id
102
            LEFT JOIN sale sa ON sa.employee_id = e.employeeid
103
             LEFT JOIN customer c ON c.customerid = sa.customer_id
104
             LEFT JOIN album al ON al.albumid = sa.album_id
105
              LEFT JOIN artist ar ON ar.artistid = al.artist_id
106
     ORDER BY
107
        s.storeid,
108
        manager.employeeid,
109
        d.departmentid,
110
        department_head.employeeid,
111
        ed.employee_id,
112
        ed.department_id,
113
        e.employeeid,
114
        sa.saleid,
115
        c.customerid,
116
        al.albumid,
117
        ar.artistid",
118
    array(
119
        'rootTag' => 'music_company',
120
        'rowTag' => 'store',
121
        'idColumn' => 'storeid',
122
        'mapper' => 'strtoupper',
123
        'attributes' => array(
124
            'storeid'
125
        ),
126
        'elements' => array(
127
            'store_sales',
128
            'store_employees',
129
            'manager' => array(
130
                'idColumn' => 'manager_employeeid',
131
                'attributes' => array(
132
                    'manager_employeeid'
133
                ),
134
                'elements' => array(
135
                    'manager_employeename'
136
                )
137
            ),
138
            'address' => array(
139
                'elements' => array(
140
                    'country',
141
                    'state' => '#Helper::getStatePostalCode()',
142
                    'city',
143
                    'street',
144
                    'phone'
145
                )
146
            ),
147
            'department' => array(
148
                'idColumn' => 'departmentid',
149
                'mapper' => 'Mappers::departmentMapper',
150
                'attributes' => array(
151
                    'departmentid'
152
                ),
153
                'elements' => array(
154
                    'department_sales',
155
                    'department_employees',
156
                    'departmentname',
157
                    'department_head' => array(
158
                        'idColumn' => 'department_head_employeeid',
159
                        'attributes' => array(
160
                            'department_head_employeeid'
161
                        ),
162
                        'elements' => array(
163
                            'department_head_employeename'
164
                        )
165
                    ),
166
                    'employees' => array(
167
                        'rootTag' => 'employees',
168
                        'rowTag' => 'employee',
169
                        'idColumn' => 'employeeid',
170
                        'mapper' => array('Mappers', 'employeeMapper'),
171
                        'attributes' => array(
172
                            'employeeid'
173
                        ),
174
                        'elements' => array(
175
                            'employeename',
176
                            'sales' => array(
177
                                'rootTag' => 'sales',
178
                                'rowTag' => 'sale',
179
                                'idColumn' => 'saleid',
180
                                'mapper' => array($myMappers, 'saleMapper'),
181
                                'attributes' => array(
182
                                    'saleid'
183
                                ),
184
                                'elements' => array(
185
                                    'timestamp',
186
                                    'customer' => array(
187
                                        'idColumn' => 'customerid',
188
                                        'mapper' => false,
189
                                        'attributes' => array(
190
                                            'customerid'
191
                                        ),
192
                                        'elements' => array(
193
                                            'first_name',
194
                                            'last_name',
195
                                            'email'
196
                                        )
197
                                    ),
198
                                    'album' => array(
199
                                        'idColumn' => 'albumid',
200
                                        'mapper' => 'XML_Query2XML_ISO9075Mapper::map',
201
                                        'attributes' => array(
202
                                            'albumid'
203
                                        ),
204
                                        'elements' => array(
205
                                            'title',
206
                                            'published_year',
207
                                            'comment' => '?#Helper::summarizeComment(12)',
208
                                            'artist' => array(
209
                                                'idColumn' => 'artistid',
210
                                                'mapper' => 'mapArtist',
211
                                                'attributes' => array(
212
                                                    'artistid'
213
                                                ),
214
                                                'elements' => array(
215
                                                    'name',
216
                                                    'birth_year',
217
                                                    'birth_place',
218
                                                    'genre'
219
                                                )
220
                                            )
221
                                        ) // album elements
222
                                    ) //album array
223
                                ) //sales elements
224
                            ) //sales array
225
                        ) //employees elements
226
                    ) //employees array
227
                ) //department elements
228
            ) // department array
229
        ) //root elements
230
    ) //root
231
); //getXML method call
232
 
233
$root = $dom->firstChild;
234
$root->setAttribute('date_generated', '2005-08-23T14:52:50');
235
 
236
header('Content-Type: application/xml');
237
 
238
$dom->formatOutput = true;
239
print $dom->saveXML();
240
 
241
 
242
 
243
/**Static class that provides validation and parsing methods for
244
* generating XML.
245
*
246
* It is static so that we can easyly call its methods from inside
247
* Query2XML using eval'd code.
248
*/
249
class Helper
250
{
251
    /**Associative array of US postal state codes*/
252
    public static $statePostalCodes = array(
253
        'ALABAMA' => 'AL', 'ALASKA' => 'AK', 'AMERICAN SAMOA' => 'AS', 'ARIZONA' => 'AZ', 'ARKANSAS' => 'AR', 'CALIFORNIA' => 'CA',
254
        'COLORADO' => 'CO', 'CONNECTICUT' => 'CT', 'DELAWARE' => 'DE', 'DISTRICT OF COLUMBIA' => 'DC', 'FEDERATED STATES OF MICRONESIA' => 'FM',
255
        'FLORIDA' => 'FL', 'GEORGIA' => 'GA', 'GUAM' => 'GU', 'HAWAII' => 'HI', 'IDAHO' => 'ID', 'ILLINOIS' => 'IL', 'INDIANA' => 'IN',
256
        'IOWA' => 'IA', 'KANSAS' => 'KS', 'KENTUCKY' => 'KY', 'LOUISIANA' => 'LA', 'MAINE' => 'ME', 'MARSHALL ISLANDS' => 'MH', 'MARYLAND' => 'MD',
257
        'MASSACHUSETTS' => 'MA', 'MICHIGAN' => 'MI', 'MINNESOTA' => 'MN', 'MISSISSIPPI' => 'MS', 'MISSOURI' => 'MO', 'MONTANA' => 'MT',
258
        'NEBRASKA' => 'NE', 'NEVADA' => 'NV', 'NEW HAMPSHIRE' => 'NH', 'NEW JERSEY' => 'NJ', 'NEW JESEY' => 'NJ', 'NEW MEXICO' => 'NM', 'NEW YORK' => 'NY',
259
        'NORTH CAROLINA' => 'NC', 'NORTH DAKOTA' => 'ND', 'NORTHERN MARIANA ISLANDS' => 'MP', 'OHIO' => 'OH', 'OKLAHOMA' => 'OK', 'OREGON' => 'OR',
260
        'PALAU' => 'PW', 'PENNSYLVANIA' => 'PA', 'PUERTO RICO' => 'PR', 'RHODE ISLAND' => 'RI', 'SOUTH CAROLINA' => 'SC', 'SOUTH DAKOTA' => 'SD',
261
        'TENNESSEE' => 'TN', 'TEXAS' => 'TX', 'UTAH' => 'UT', 'VERMONT' => 'VT', 'VIRGIN ISLANDS' => 'VI', 'VIRGINIA' => 'VA', 'WASHINGTON' => 'WA',
262
        'WEST VIRGINIA' => 'WV', 'WISCONSIN' => 'WI', 'WYOMING' => 'WY'
263
    );
264
 
265
    /**Translates a US state name into its two-letter postal code.
266
    * If the translation fails, $state is returned unchanged
267
    * @param $record The record
268
    */
269
    public static function getStatePostalCode($record)
270
    {
271
        $state = $record["state"];
272
        $s = str_replace("  ", " ", trim(strtoupper($state)));
273
        if (isset(self::$statePostalCodes[$s])) {
274
            return self::$statePostalCodes[$s];
275
        } else {
276
            return $state;
277
        }
278
    }
279
 
280
    function summarize($str, $limit=50, $appendString=' ...')
281
    {
282
        if (strlen($str) > $limit) {
283
            $str = substr($str, 0, $limit - strlen($appendString)) . $appendString;
284
        }
285
        return $str;
286
    }
287
 
288
 
289
    function summarizeComment($record, $limit)
290
    {
291
        return self::summarize($record["comment"], $limit);
292
    }
293
}
294
?>
295
--EXPECT--
296
<?xml version="1.0" encoding="UTF-8"?>
297
<music_company date_generated="2005-08-23T14:52:50">
298
  <store STOREID="1">
299
    <STORE_SALES>10</STORE_SALES>
300
    <STORE_EMPLOYEES>6</STORE_EMPLOYEES>
301
    <manager MANAGER_EMPLOYEEID="1">
302
      <MANAGER_EMPLOYEENAME>Michael Jones</MANAGER_EMPLOYEENAME>
303
    </manager>
304
    <address>
305
      <COUNTRY>US</COUNTRY>
306
      <STATE>NY</STATE>
307
      <CITY>New York</CITY>
308
      <STREET>Broadway &amp; 72nd Str</STREET>
309
      <PHONE>123 456 7890</PHONE>
310
    </address>
311
    <department departmentid="1">
312
      <departmentSales>10</departmentSales>
313
      <departmentEmployees>3</departmentEmployees>
314
      <departmentname>Sales</departmentname>
315
      <department_head departmentHeadEmployeeid="1">
316
        <departmentHeadEmployeename>Michael Jones</departmentHeadEmployeename>
317
      </department_head>
318
      <employees>
319
        <employee Employeeid="1">
320
          <Employeename>Michael Jones</Employeename>
321
          <sales>
322
            <sale SALEID="1">
323
              <TIMESTAMP>2005-05-25 16:32:00</TIMESTAMP>
324
              <customer customerid="1">
325
                <first_name>Jane</first_name>
326
                <last_name>Doe</last_name>
327
                <email>jane.doe@example.com</email>
328
              </customer>
329
              <album albumid="1">
330
                <title>New World Order</title>
331
                <published_year>1990</published_year>
332
                <comment>the best ...</comment>
333
                <artist artistid="1">
334
                  <name>Curtis Mayfield</name>
335
                  <birthyear>1920</birthyear>
336
                  <birthplace>Chicago</birthplace>
337
                  <genre>Soul</genre>
338
                </artist>
339
              </album>
340
            </sale>
341
            <sale SALEID="7">
342
              <TIMESTAMP>2005-07-10 15:03:00</TIMESTAMP>
343
              <customer customerid="7">
344
                <first_name>Nick</first_name>
345
                <last_name>Fallow</last_name>
346
                <email>nick.fallow@example.com</email>
347
              </customer>
348
              <album albumid="1">
349
                <title>New World Order</title>
350
                <published_year>1990</published_year>
351
                <comment>the best ...</comment>
352
                <artist artistid="1">
353
                  <name>Curtis Mayfield</name>
354
                  <birthyear>1920</birthyear>
355
                  <birthplace>Chicago</birthplace>
356
                  <genre>Soul</genre>
357
                </artist>
358
              </album>
359
            </sale>
360
            <sale SALEID="16">
361
              <TIMESTAMP>2005-06-05 12:56:12</TIMESTAMP>
362
              <customer customerid="2">
363
                <first_name>John</first_name>
364
                <last_name>Doe</last_name>
365
                <email>john.doe@example.com</email>
366
              </customer>
367
              <album albumid="3">
368
                <title>Shaft</title>
369
                <published_year>1972</published_year>
370
                <comment>he's the man</comment>
371
                <artist artistid="2">
372
                  <name>Isaac Hayes</name>
373
                  <birthyear>1942</birthyear>
374
                  <birthplace>Tennessee</birthplace>
375
                  <genre>Soul</genre>
376
                </artist>
377
              </album>
378
            </sale>
379
            <sale SALEID="19">
380
              <TIMESTAMP>2005-07-10 16:03:01</TIMESTAMP>
381
              <customer customerid="8">
382
                <first_name>Ed</first_name>
383
                <last_name>Burton</last_name>
384
                <email>ed.burton@example.com</email>
385
              </customer>
386
              <album albumid="3">
387
                <title>Shaft</title>
388
                <published_year>1972</published_year>
389
                <comment>he's the man</comment>
390
                <artist artistid="2">
391
                  <name>Isaac Hayes</name>
392
                  <birthyear>1942</birthyear>
393
                  <birthplace>Tennessee</birthplace>
394
                  <genre>Soul</genre>
395
                </artist>
396
              </album>
397
            </sale>
398
          </sales>
399
        </employee>
400
        <employee Employeeid="2">
401
          <Employeename>Susi Weintraub</Employeename>
402
          <sales>
403
            <sale SALEID="3">
404
              <TIMESTAMP>2005-07-10 11:03:00</TIMESTAMP>
405
              <customer customerid="3">
406
                <first_name>Susan</first_name>
407
                <last_name>Green</last_name>
408
                <email>susan.green@example.com</email>
409
              </customer>
410
              <album albumid="1">
411
                <title>New World Order</title>
412
                <published_year>1990</published_year>
413
                <comment>the best ...</comment>
414
                <artist artistid="1">
415
                  <name>Curtis Mayfield</name>
416
                  <birthyear>1920</birthyear>
417
                  <birthplace>Chicago</birthplace>
418
                  <genre>Soul</genre>
419
                </artist>
420
              </album>
421
            </sale>
422
            <sale SALEID="9">
423
              <TIMESTAMP>2005-07-10 18:03:00</TIMESTAMP>
424
              <customer customerid="9">
425
                <first_name>Jack</first_name>
426
                <last_name>Woo</last_name>
427
                <email>jack.woo@example.com</email>
428
              </customer>
429
              <album albumid="1">
430
                <title>New World Order</title>
431
                <published_year>1990</published_year>
432
                <comment>the best ...</comment>
433
                <artist artistid="1">
434
                  <name>Curtis Mayfield</name>
435
                  <birthyear>1920</birthyear>
436
                  <birthplace>Chicago</birthplace>
437
                  <genre>Soul</genre>
438
                </artist>
439
              </album>
440
            </sale>
441
            <sale SALEID="17">
442
              <TIMESTAMP>2005-07-10 10:03:32</TIMESTAMP>
443
              <customer customerid="4">
444
                <first_name>Victoria</first_name>
445
                <last_name>Alt</last_name>
446
                <email>victory.alt@example.com</email>
447
              </customer>
448
              <album albumid="3">
449
                <title>Shaft</title>
450
                <published_year>1972</published_year>
451
                <comment>he's the man</comment>
452
                <artist artistid="2">
453
                  <name>Isaac Hayes</name>
454
                  <birthyear>1942</birthyear>
455
                  <birthplace>Tennessee</birthplace>
456
                  <genre>Soul</genre>
457
                </artist>
458
              </album>
459
            </sale>
460
            <sale SALEID="20">
461
              <TIMESTAMP>2005-07-10 19:03:50</TIMESTAMP>
462
              <customer customerid="10">
463
                <first_name>Maria</first_name>
464
                <last_name>Gonzales</last_name>
465
                <email>maria.gonzales@example.com</email>
466
              </customer>
467
              <album albumid="3">
468
                <title>Shaft</title>
469
                <published_year>1972</published_year>
470
                <comment>he's the man</comment>
471
                <artist artistid="2">
472
                  <name>Isaac Hayes</name>
473
                  <birthyear>1942</birthyear>
474
                  <birthplace>Tennessee</birthplace>
475
                  <genre>Soul</genre>
476
                </artist>
477
              </album>
478
            </sale>
479
          </sales>
480
        </employee>
481
        <employee Employeeid="3">
482
          <Employeename>Steve Hack</Employeename>
483
          <sales>
484
            <sale SALEID="5">
485
              <TIMESTAMP>2005-07-10 13:03:00</TIMESTAMP>
486
              <customer customerid="5">
487
                <first_name>Will</first_name>
488
                <last_name>Rippy</last_name>
489
                <email>will.wippy@example.com</email>
490
              </customer>
491
              <album albumid="1">
492
                <title>New World Order</title>
493
                <published_year>1990</published_year>
494
                <comment>the best ...</comment>
495
                <artist artistid="1">
496
                  <name>Curtis Mayfield</name>
497
                  <birthyear>1920</birthyear>
498
                  <birthplace>Chicago</birthplace>
499
                  <genre>Soul</genre>
500
                </artist>
501
              </album>
502
            </sale>
503
            <sale SALEID="18">
504
              <TIMESTAMP>2005-07-10 14:03:52</TIMESTAMP>
505
              <customer customerid="6">
506
                <first_name>Tim</first_name>
507
                <last_name>Raw</last_name>
508
                <email>tim.raw@example.com</email>
509
              </customer>
510
              <album albumid="3">
511
                <title>Shaft</title>
512
                <published_year>1972</published_year>
513
                <comment>he's the man</comment>
514
                <artist artistid="2">
515
                  <name>Isaac Hayes</name>
516
                  <birthyear>1942</birthyear>
517
                  <birthplace>Tennessee</birthplace>
518
                  <genre>Soul</genre>
519
                </artist>
520
              </album>
521
            </sale>
522
          </sales>
523
        </employee>
524
      </employees>
525
    </department>
526
    <department departmentid="2">
527
      <departmentSales>0</departmentSales>
528
      <departmentEmployees>3</departmentEmployees>
529
      <departmentname>Marketing</departmentname>
530
      <department_head departmentHeadEmployeeid="4">
531
        <departmentHeadEmployeename>Joan Kerr</departmentHeadEmployeename>
532
      </department_head>
533
      <employees>
534
        <employee Employeeid="4">
535
          <Employeename>Joan Kerr</Employeename>
536
          <sales/>
537
        </employee>
538
        <employee Employeeid="5">
539
          <Employeename>Marcus Roth</Employeename>
540
          <sales/>
541
        </employee>
542
        <employee Employeeid="6">
543
          <Employeename>Jack Mack</Employeename>
544
          <sales/>
545
        </employee>
546
      </employees>
547
    </department>
548
  </store>
549
  <store STOREID="2">
550
    <STORE_SALES>10</STORE_SALES>
551
    <STORE_EMPLOYEES>6</STORE_EMPLOYEES>
552
    <manager MANAGER_EMPLOYEEID="2">
553
      <MANAGER_EMPLOYEENAME>Susi Weintraub</MANAGER_EMPLOYEENAME>
554
    </manager>
555
    <address>
556
      <COUNTRY>US</COUNTRY>
557
      <STATE>NY</STATE>
558
      <CITY>Larchmont</CITY>
559
      <STREET>Palmer Ave 71</STREET>
560
      <PHONE>456 7890</PHONE>
561
    </address>
562
    <department departmentid="3">
563
      <departmentSales>10</departmentSales>
564
      <departmentEmployees>3</departmentEmployees>
565
      <departmentname>Sales</departmentname>
566
      <department_head departmentHeadEmployeeid="7">
567
        <departmentHeadEmployeename>Rita Doktor</departmentHeadEmployeename>
568
      </department_head>
569
      <employees>
570
        <employee Employeeid="7">
571
          <Employeename>Rita Doktor</Employeename>
572
          <sales>
573
            <sale SALEID="2">
574
              <TIMESTAMP>2005-06-05 12:56:00</TIMESTAMP>
575
              <customer customerid="2">
576
                <first_name>John</first_name>
577
                <last_name>Doe</last_name>
578
                <email>john.doe@example.com</email>
579
              </customer>
580
              <album albumid="1">
581
                <title>New World Order</title>
582
                <published_year>1990</published_year>
583
                <comment>the best ...</comment>
584
                <artist artistid="1">
585
                  <name>Curtis Mayfield</name>
586
                  <birthyear>1920</birthyear>
587
                  <birthplace>Chicago</birthplace>
588
                  <genre>Soul</genre>
589
                </artist>
590
              </album>
591
            </sale>
592
            <sale SALEID="8">
593
              <TIMESTAMP>2005-07-10 16:03:00</TIMESTAMP>
594
              <customer customerid="8">
595
                <first_name>Ed</first_name>
596
                <last_name>Burton</last_name>
597
                <email>ed.burton@example.com</email>
598
              </customer>
599
              <album albumid="1">
600
                <title>New World Order</title>
601
                <published_year>1990</published_year>
602
                <comment>the best ...</comment>
603
                <artist artistid="1">
604
                  <name>Curtis Mayfield</name>
605
                  <birthyear>1920</birthyear>
606
                  <birthplace>Chicago</birthplace>
607
                  <genre>Soul</genre>
608
                </artist>
609
              </album>
610
            </sale>
611
            <sale SALEID="11">
612
              <TIMESTAMP>2005-05-25 16:23:00</TIMESTAMP>
613
              <customer customerid="1">
614
                <first_name>Jane</first_name>
615
                <last_name>Doe</last_name>
616
                <email>jane.doe@example.com</email>
617
              </customer>
618
              <album albumid="2">
619
                <title>Curtis</title>
620
                <published_year>1970</published_year>
621
                <comment>that man ...</comment>
622
                <artist artistid="1">
623
                  <name>Curtis Mayfield</name>
624
                  <birthyear>1920</birthyear>
625
                  <birthplace>Chicago</birthplace>
626
                  <genre>Soul</genre>
627
                </artist>
628
              </album>
629
            </sale>
630
            <sale SALEID="14">
631
              <TIMESTAMP>2005-07-10 15:09:00</TIMESTAMP>
632
              <customer customerid="7">
633
                <first_name>Nick</first_name>
634
                <last_name>Fallow</last_name>
635
                <email>nick.fallow@example.com</email>
636
              </customer>
637
              <album albumid="2">
638
                <title>Curtis</title>
639
                <published_year>1970</published_year>
640
                <comment>that man ...</comment>
641
                <artist artistid="1">
642
                  <name>Curtis Mayfield</name>
643
                  <birthyear>1920</birthyear>
644
                  <birthplace>Chicago</birthplace>
645
                  <genre>Soul</genre>
646
                </artist>
647
              </album>
648
            </sale>
649
          </sales>
650
        </employee>
651
        <employee Employeeid="8">
652
          <Employeename>David Til</Employeename>
653
          <sales>
654
            <sale SALEID="4">
655
              <TIMESTAMP>2005-07-10 10:03:00</TIMESTAMP>
656
              <customer customerid="4">
657
                <first_name>Victoria</first_name>
658
                <last_name>Alt</last_name>
659
                <email>victory.alt@example.com</email>
660
              </customer>
661
              <album albumid="1">
662
                <title>New World Order</title>
663
                <published_year>1990</published_year>
664
                <comment>the best ...</comment>
665
                <artist artistid="1">
666
                  <name>Curtis Mayfield</name>
667
                  <birthyear>1920</birthyear>
668
                  <birthplace>Chicago</birthplace>
669
                  <genre>Soul</genre>
670
                </artist>
671
              </album>
672
            </sale>
673
            <sale SALEID="10">
674
              <TIMESTAMP>2005-07-10 19:03:00</TIMESTAMP>
675
              <customer customerid="10">
676
                <first_name>Maria</first_name>
677
                <last_name>Gonzales</last_name>
678
                <email>maria.gonzales@example.com</email>
679
              </customer>
680
              <album albumid="1">
681
                <title>New World Order</title>
682
                <published_year>1990</published_year>
683
                <comment>the best ...</comment>
684
                <artist artistid="1">
685
                  <name>Curtis Mayfield</name>
686
                  <birthyear>1920</birthyear>
687
                  <birthplace>Chicago</birthplace>
688
                  <genre>Soul</genre>
689
                </artist>
690
              </album>
691
            </sale>
692
            <sale SALEID="12">
693
              <TIMESTAMP>2005-07-10 11:56:00</TIMESTAMP>
694
              <customer customerid="3">
695
                <first_name>Susan</first_name>
696
                <last_name>Green</last_name>
697
                <email>susan.green@example.com</email>
698
              </customer>
699
              <album albumid="2">
700
                <title>Curtis</title>
701
                <published_year>1970</published_year>
702
                <comment>that man ...</comment>
703
                <artist artistid="1">
704
                  <name>Curtis Mayfield</name>
705
                  <birthyear>1920</birthyear>
706
                  <birthplace>Chicago</birthplace>
707
                  <genre>Soul</genre>
708
                </artist>
709
              </album>
710
            </sale>
711
            <sale SALEID="15">
712
              <TIMESTAMP>2005-07-10 18:49:00</TIMESTAMP>
713
              <customer customerid="9">
714
                <first_name>Jack</first_name>
715
                <last_name>Woo</last_name>
716
                <email>jack.woo@example.com</email>
717
              </customer>
718
              <album albumid="2">
719
                <title>Curtis</title>
720
                <published_year>1970</published_year>
721
                <comment>that man ...</comment>
722
                <artist artistid="1">
723
                  <name>Curtis Mayfield</name>
724
                  <birthyear>1920</birthyear>
725
                  <birthplace>Chicago</birthplace>
726
                  <genre>Soul</genre>
727
                </artist>
728
              </album>
729
            </sale>
730
          </sales>
731
        </employee>
732
        <employee Employeeid="9">
733
          <Employeename>Pia Eist</Employeename>
734
          <sales>
735
            <sale SALEID="6">
736
              <TIMESTAMP>2005-07-10 14:03:00</TIMESTAMP>
737
              <customer customerid="6">
738
                <first_name>Tim</first_name>
739
                <last_name>Raw</last_name>
740
                <email>tim.raw@example.com</email>
741
              </customer>
742
              <album albumid="1">
743
                <title>New World Order</title>
744
                <published_year>1990</published_year>
745
                <comment>the best ...</comment>
746
                <artist artistid="1">
747
                  <name>Curtis Mayfield</name>
748
                  <birthyear>1920</birthyear>
749
                  <birthplace>Chicago</birthplace>
750
                  <genre>Soul</genre>
751
                </artist>
752
              </album>
753
            </sale>
754
            <sale SALEID="13">
755
              <TIMESTAMP>2005-07-10 13:12:00</TIMESTAMP>
756
              <customer customerid="5">
757
                <first_name>Will</first_name>
758
                <last_name>Rippy</last_name>
759
                <email>will.wippy@example.com</email>
760
              </customer>
761
              <album albumid="2">
762
                <title>Curtis</title>
763
                <published_year>1970</published_year>
764
                <comment>that man ...</comment>
765
                <artist artistid="1">
766
                  <name>Curtis Mayfield</name>
767
                  <birthyear>1920</birthyear>
768
                  <birthplace>Chicago</birthplace>
769
                  <genre>Soul</genre>
770
                </artist>
771
              </album>
772
            </sale>
773
          </sales>
774
        </employee>
775
      </employees>
776
    </department>
777
    <department departmentid="4">
778
      <departmentSales>0</departmentSales>
779
      <departmentEmployees>3</departmentEmployees>
780
      <departmentname>Marketing</departmentname>
781
      <department_head departmentHeadEmployeeid="10">
782
        <departmentHeadEmployeename>Hanna Poll</departmentHeadEmployeename>
783
      </department_head>
784
      <employees>
785
        <employee Employeeid="10">
786
          <Employeename>Hanna Poll</Employeename>
787
          <sales/>
788
        </employee>
789
        <employee Employeeid="11">
790
          <Employeename>Jim Wells</Employeename>
791
          <sales/>
792
        </employee>
793
        <employee Employeeid="12">
794
          <Employeename>Sandra Wilson</Employeename>
795
          <sales/>
796
        </employee>
797
      </employees>
798
    </department>
799
  </store>
800
</music_company>