Visual Basic.NET
  Home arrow Visual Basic.NET arrow Reading and Transforming XML Documents usi...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
VISUAL BASIC.NET

Reading and Transforming XML Documents using Visual Basic 2005
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 11
    2006-11-21

    Table of Contents:
  • Reading and Transforming XML Documents using Visual Basic 2005
  • Reading the tags in an XML document using XMLReader
  • Reading the values (or text) of XML tags in an XML document using XMLReader
  • Reading an XML string using XMLReader
  • Transforming an XML document to HTML using XSLT with VB 2005
  • Transformation using XSLT for multiple XML nodes of the same criteria

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Reading and Transforming XML Documents using Visual Basic 2005
    (Page 1 of 6 )

    This article mainly focuses on reading XML documents in several ways using Visual Basic.NET 2005. Topics discussed include the XMLReader and XSLT, among others.
    A downloadable zip file is available for this article.

    This article mainly focuses on reading XML documents in several ways using Visual Basic.NET 2005.

    If you are new to designing XML Schemas, I suggest you to refer my following articles:

    http://www.devarticles.com/c/a/XML/Designing-Your-own-XML-Schema-Learn-the-
    Essentials/

    http://www.devarticles.com/c/a/XML/Designing-Your-own-XML-Schema-
    Constraining-with-Restrictions/

    http://www.devarticles.com/c/a/XML/Designing-Your-own-XML-Schema-
    Restrictions-and-User-Defined-Types/

    http://www.devarticles.com/c/a/XML/Designing-Your-Own-XML-Schema-Indicators/

    http://www.devarticles.com/c/a/XML/Introduction-to-Relations-in-XML-Schema/

    http://www.devarticles.com/c/a/XML/OneOne-OneMany-and-ManyMany-Relations-
    in-XML-Schema/

    The entire source code for this article is available in the form of a downloadable zip file. The solution was developed using Microsoft Visual Studio 2005 Professional Edition on Microsoft Windows Server 2003 Enterprise Edition together. I didn’t really test the solution with any other/previous editions. If you have any problems in executing the solution, please post in the discussion area.

    XML Schema and XML document

    An XML document is simply a text file with some hierarchical and structural user-defined tags (like HTML tags) containing user-provided data. The syntax, grammar, rules, structure, hierarchy, constraints etc. of a particular XML document is defined using XML Schema (which is also an XML document, but with the XSD extension).

    To work with this article, I worked with the following XML document (Employee.xml):

    <?xml version="1.0" encoding="utf-8"?>

    <Employees xmlns="http://tempuri.org/Employee.xsd">

          <Employee>

                <Empno>1001</Empno>

                <Ename>Jagadish</Ename>

                <Sal>3400</Sal>

                <Deptno>20</Deptno>

          </Employee>

          <Employee>

                <Empno>1002</Empno>

                <Ename>Chatarji</Ename>

                <Sal>4500</Sal>

                <Deptno>10</Deptno>

          </Employee>

          <Employee>

                <Empno>1003</Empno>

                <Ename>Winner</Ename>

                <Sal>3700</Sal>

                <Deptno>10</Deptno>

          </Employee>

          <Employee>

                <Empno>1004</Empno>

                <Ename>Dhanam</Ename>

                <Sal>4300</Sal>

                <Deptno>20</Deptno>

          </Employee>

    </Employees>

    The XML Schema for the above XML document is defined as follows:

    <?xml version="1.0" encoding="utf-8"?>

    <xs:schema id="Employee" targetNamespace=
    "http://tempuri.org/Employee.xsd" elementFormDefault=
    "qualified" xmlns="http://tempuri.org/Employee.xsd" 
    xmlns:mstns="http://tempuri.org/Employee.xsd" xmlns:xs=
    "http://www.w3.org/2001/XMLSchema">

          <xs:element name="Employees">

                <xs:complexType>

                      <xs:sequence>

                            <xs:element name="Employee" maxOccurs="unbounded">

                                  <xs:complexType>

                                        <xs:sequence>

                                              <xs:element name="Empno" type="xs:string"/>

                                              <xs:element name="Ename" type="xs:string"/>

                                              <xs:element name="Sal" type="xs:int"/>

                                              <xs:element name="Deptno" type="xs:int"/>

                                        </xs:sequence>

                                  </xs:complexType>

                            </xs:element>

                      </xs:sequence>

                </xs:complexType>

          </xs:element>

    </xs:schema>

    More Visual Basic.NET Articles
    More By Jagadish Chaterjee


       · Hello guys! this is the article which helps you to parse through XML documents using...
     

    VISUAL BASIC.NET ARTICLES

    - Types of Operators in Visual Basic
    - Operators
    - Understanding Custom Events using Visual Bas...
    - Polymorphism using Abstract Classes in Visua...
    - Shadowing using Shadows in Visual Basic.NET ...
    - Overloading and Overriding in Visual Basic.N...
    - More on Controlling Windows Fax Services Usi...
    - Programmatically Controlling Windows Fax Ser...
    - Focusing on Forms and Menus in Visual Basic
    - Manipulating Forms with the Windows Forms Li...
    - Basics of the Windows Forms Library
    - Forms, Controls, and Other Useful Objects
    - Implementing OOP to Develop Database Oriente...
    - Using Themes and Skins for Personalization w...
    - A Deeper Look at Personalization using Visua...

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway