Tipworld -> XML
ID Names

When I first tried using ID attributes, I was attempting to dump a database table to XML. I thought an ID attribute would provide a cool way to store my database key with the corresponding XML element. I quickly found that ID names are bound by the same rules as XML elements. For instance, you cannot start them with a number. If you use integer types for database keys... well, you see the problem. An easy way to get around this is to append a character to the front of the id. If the database key for Bubba in the Person table is 22, you could use something like this:

<Person id="i22">Bubba</Person>