Visual Basic 2005 XML Programming Using XML DOM - Sample XML document: source
(Page 2 of 6 )
Now that we understand the structure of the sample XML document (from the previous section), we need to have some sample XML data to work with .NET.
The following is the XML source used as a sample in the .NET application. It follows the same structure as explained in the previous section. I named it MyXML.xml.
<?xml version="1.0" encoding="utf-8"?>
<CompanyInfo>
<DepartmentInfo>
<!-- contains all departments and employees-->
<Department ID="D10">
<Deptno>10</Deptno>
<Dname>Accounting</Dname>
<Location>Dallas</Location>
<EmployeeInfo>
<Employee ID="E1">
<Empno>1001</Empno>
<Ename>Jag</Ename>
<Sal>2300</Sal>
<Deptno>10</Deptno>
</Employee>
<Employee ID="E2">
<Empno>1002</Empno>
<Ename>Chat</Ename>
<Sal>3400</Sal>
<Deptno>10</Deptno>
</Employee>
<Employee ID="E3">
<Empno>1003</Empno>
<Ename>Winner</Ename>
<Sal>4500</Sal>
<Deptno>10</Deptno>
</Employee>
</EmployeeInfo>
</Department>
<Department ID="D20">
<Deptno>20</Deptno>
<Dname>Sales</Dname>
<Location>New York</Location>
<EmployeeInfo>
<Employee ID="E4">
<Empno>1004</Empno>
<Ename>Ram</Ename>
<Sal>3400</Sal>
<Deptno>20</Deptno>
</Employee>
<Employee ID="E5">
<Empno>1005</Empno>
<Ename>Raj</Ename>
<Sal>4500</Sal>
<Deptno>20</Deptno>
</Employee>
</EmployeeInfo>
</Department>
<Department ID="D30">
<Deptno>30</Deptno>
<Dname>Production</Dname>
<Location>DC</Location>
<EmployeeInfo>
<Employee ID="E6">
<Empno>1006</Empno>
<Ename>aaa</Ename>
<Sal>3400</Sal>
<Deptno>30</Deptno>
</Employee>
<Employee ID="E7">
<Empno>1007</Empno>
<Ename>bbb</Ename>
<Sal>4300</Sal>
<Deptno>30</Deptno>
</Employee>
</EmployeeInfo>
</Department>
<Department ID="D40">
<Deptno>40</Deptno>
<Dname>IT</Dname>
<Location>LA</Location>
<EmployeeInfo>
<Employee ID="E8">
<Empno>1008</Empno>
<Ename>xxx</Ename>
<Sal>2900</Sal>
<Deptno>40</Deptno>
</Employee>
<Employee ID="E9">
<Empno>1009</Empno>
<Ename>yyy</Ename>
<Sal>4600</Sal>
<Deptno>40</Deptno>
</Employee>
</EmployeeInfo>
</Department>
</DepartmentInfo>
</CompanyInfo>
Next: Loading/Searching an XML document with XML DOM using Visual Basic.NET >>
More Windows Scripting Articles
More By Jagadish Chaterjee