[Previous] [Contents] [Next]


Database Loading


Refer to Listing 14.1. It would be a good idea to have this information in a database or a spreadsheet. In fact, this is how XML is mainly perceived by Microsoft: as a delivery and exchange format for structured data. And structured data normally resides in relational databases.

In the foreseeable future, you will have XML writers and XML readers for every database. However, you can write some code yourself to generate a comma-separated values file, as shown in Listing 14.5.

Listing 14.5 musicians.csv-A Comma-Separated Values File
1: Name,Instrument,NrOfRecordings
2: Joey Baron,drums,1
3: Bill Frisell,guitar,3
4: Don Byron,clarinet,2
5: Dave Douglas,trumpet,1

Or you can write some SQL code, as in Listing 14.6.

Listing 14.6 Some SQL Code
 1: create table musicians (
 2:     name text not null primary key,
 3:     instrument text,
 4:     nrofrecordings integer
 5: );
 6: insert into musicians values ('Joey Baron','drums',1);
 7: insert into musicians values ('Bill Frisell','guitar',3);
 8: insert into musicians values ('Don Byron','clarinet',2);
 9: insert into musicians values ('Dave Douglas','trumpet',1);


[Previous] [Contents] [Next]