Thursday, May 19, 2005

Creating a Class from xml

For any of you writing api's for today's hottest websites (say that like your a game show host), there is a great tool that will turn an xml document into a cs file. The tool is xsd and comes with Visual Studio .NET. Here's how it works:

1. Use the following text to make a file called c:\table.xml:

<?xml version="1.0" encoding="UTF-8"?>
<table cellpadding="0" cellspacing="0" border="1">
<th>Col 1</th>
<th>Col 2</th>
<th>Col 3</th>
<td>col 1 row 1</td>
<td>col 2 row 1</td>
<td>col 3 row 1</td>
<td>col 1 row 2</td>
<td>col 2 row 2</td>
<td>col 3 row 2</td>
<td>col 1 row 3</td>
<td>col 2 row 3</td>
<td>col 3 row 3</td>

2. Open cmd and goto c:.
3. Run the following: xsd table.xml
4. See the file created c:\table.xsd
5. Run the following: xsd table.xsd /t:lib /l:cs /c /namespace:xmltest
6. See the file created c:\table.cs

Isn't that cool? It makes all the classes and even makes arrays. Admittedly, it would be better if it made strongly typed collections, but it is not bad.

[tags: ]

Monday, May 16, 2005

Hello Cleveland!

Well it has been a long time since I wrote anything here. I have been super busy with deshuffle, which was going very well before I left for vacation, and got sick. I am still sick. I haven't touched it in weeks. Hopefully it will be live before too long.

Anyway, vacation was great! We had a great time with my Dad and Step-Mom in LA, and with Gil in the bay area. I shot about eight hours of video and took about 700 pictures.

Work is going well.

I just vaped my laptop and put 2003 on it (2000 was getting way too slow).

Amelia and Abby are doing very well. Kim is sick too :( though.