Let us focus on XML tools that are available on Visual Studio 2005. In order to do so, we will need an XML file. One has been provided for you in the Lesson 2 directory. Let us go ahead and add this to our project.
Right click on your SOLUTION, select ADD, select EXISTING ITEM. Navigate to your desktop, your project files directory, Part 1, Lesson 2. Go ahead and select all files and now you see the stock XML file. Go ahead and double click on that. This adds the stocks XML file to your SOLUTION explorer. In order to work with the XML editor, we will need to double click this.
In order to get to more real estate, let us go to the property windows out of the way. As I can see my stock XML files now appears now in my XML editor. I can go ahead and expand and collapse these elements simply by clicking on these rectangles. I can also make edits to my file. Even in the XML editor, I can still see code revision marks. If I hit CTRL+ S and save my file, the code revision mark turns green.
This is one way I can look at my data, expand and collapse the notes using XML. What if I want a nicer interphase? I can actually look at this data in a different format, in a spreadsheet format. Let us go ahead and right click on this stock XML file.
Select OPEN WITH, this pops up, the Open with dialog. I have a variety of editors I can use to edit my XML file. In this case, I want to use the XML Data Editor and click “OK.”
Now I am looking at the same exact data, the same exact XML file but in a spreadsheet format. If I make a change here, it will automatically be reflected in the XML file. You can see the XML file up here has indicated that the state has been changed with this small asterisk.
On the left hand side, I see data tables. In this case I only have one data table called “ticker.” But if I had multiple data tables here, I would see them listed. Right click on your spreadsheet. You can also go right into the code from here. And I am now back to my XML editor.
Transcription by:
Scribe4you Transcription Services