Logo

Navigation
  • Home
  • Services
    • ERP Solutions
    • Implementation Solutions
    • Support and Maintenance Solutions
    • Custom Solutions
    • Upgrade Solutions
    • Training and Mentoring
    • Web Solutions
    • Production Support
    • Architecture Designing
    • Independent Validation and Testing Services
    • Infrastructure Management
  • Expertise
    • Microsoft Development Expertise
    • Mobile Development
    • SQL Server Database and BI
    • SAP BI, SAP Hana, SAP BO
    • Oracle and BI
    • Oracle RAC
  • Technical Training
    • Learn Data Management
      • Business Intelligence
      • Data Mining
      • Data Modeling
      • Data Warehousing
      • Disaster Recovery
    • Learn Concepts
      • Application Development
      • Client Server
      • Cloud Computing Tutorials
      • Cluster Computing
      • CRM Tutorial
      • EDI Tutorials
      • ERP Tutorials
      • NLP
      • OOPS
      • Concepts
      • SOA Tutorial
      • Supply Chain
      • Technology Trends
      • UML
      • Virtualization
      • Web 2.0
    • Learn Java
      • JavaScript Tutorial
      • JSP Tutorials
      • J2EE
    • Learn Microsoft
      • MSAS
      • ASP.NET
      • ASP.NET 2.0
      • C Sharp
      • MS Project Training
      • Silverlight
      • SQL Server 2005
      • VB.NET 2005
    • Learn Networking
      • Networking
      • Wireless
    • Learn Oracle
      • Oracle 10g
      • PL/SQL
      • Oracle 11g Tutorials
      • Oracle 9i
      • Oracle Apps
    • Learn Programming
      • Ajax Tutorial
      • C Language
      • C++ Tutorials
      • CSS Tutorial
      • CSS3 Tutorial
      • JavaScript Tutorial
      • jQuery Tutorial
      • MainFrame
      • PHP Tutorial
      • VBScript Tutorial
      • XML Tutorial
    • Learn Software Testing
      • Software Testing Types
      • SQA
      • Testing
  • Career Training
    • Career Improvement
      • Career Articles
      • Certification Articles
      • Conflict Management
      • Core Skills
      • Decision Making
      • Entrepreneurship
      • Goal Setting
      • Life Skills
      • Performance Development
      • Personal Excellence
      • Personality Development
      • Problem Solving
      • Relationship Management
      • Self Confidence
      • Self Supervision
      • Social Networking
      • Strategic Planning
      • Time Management
    • Education Help
      • Career Tracks
      • Essay Writing
      • Internship Tips
      • Online Education
      • Scholarships
      • Student Loans
    • Managerial Skills
      • Business Communication
      • Business Networking
      • Facilitator Skills
      • Managing Change
      • Marketing Management
      • Meeting Management
      • Process Management
      • Project Management
      • Project Management Life Cycle
      • Project Management Process
      • Project Risk Management
      • Relationship Management
      • Task Management
      • Team Building
      • Virtual Team Management
    • Essential Life Skills
      • Anger Management
      • Anxiety Management
      • Attitude Development
      • Coaching and Mentoring
      • Emotional Intelligence
      • Stress Management
      • Positive Thinking
    • Communication Skills
      • Conversation Skills
      • Cross Culture Competence
      • English Vocabulary
      • Listening Skills
      • Public Speaking Skills
      • Questioning Skills
    • Soft Skills
      • Assertive Skills
      • Influence Skills
      • Leadership Skills
      • Memory Skills
      • People Skills
      • Presentation Skills
    • Finding a Job
      • Etiquette Tips
      • Group Discussions
      • HR Interviews
      • Interview Notes
      • Job Search Tips
      • Resume Tips
      • Sample Resumes
 

Working with XML in Visual Basic

By Exforsys | on August 28, 2007 |
XML Tutorial

Working with XML in Visual Basic

Extensive markup language and Visual Basic is the odd couple of the industry. Visual Basic is one of the most common languages that are being used today. This Microsoft introduced language was meant to be middle tier in characteristic but has managed to get the top tier position when it comes to programming, developing client and server applications. This is mainly because it is quick and easy and doesn’t need thousands of lines of codes to be written.

The relationship between VB, DOM and XSLT

The Document Object Model or the DOM was first used by Microsoft parser in XML which in turn led to the XML DOM.

To link a library like MSXML to Visual Basic, a reference is created to it and by selecting the projects references in the program environment and also the relevant DLL or EXE file has to be selected. When it comes to the new MSML parser, the "Microsoft XML, v3.0" entry is already selected. This converts the MSXML3.dll easily so that it can be used, and it also has all the functionalities of Microsoft XML.

There are five components o which the DOM is based on and they are the documents which are of XML, related nodes, and their node lists, the elements, and their attributes. Each of these components have their own individual and unique interfaces for programming in specific to the DOM Documents, and the other five components also like the DOMXML node, DOMXML Node lists, DOMXML elements and the DOMXML attributes.

Each of these components will expose a number of modes and properties. For instance, the loading and saving of an XML document is handled by the DOM document and files and they also convert an XML structured string from an external document to an internal DOM document. While the DOM interface is handling the attributes related to referencing, and text context of the content, and element children, it also provides a facility to generate Xpath queries using a starting point.

The World Wide Web consortium does not support the specification of Xpath but it ends up playing a large role in the utility of the MSXML parser when it is dealing with XML data. XPath is more familiar than the most because it is the language that is used by XSLT to a select group of nodes and which is contained by a given XML tree so that it can create node sets.

These terminologies did not exist when the DOM was proposed for the first time; however Microsoft started referring to the node sets as node lists which coined its name that is being used so commonly today. Microsoft Parser supports the XMLDOM node sets and lists them all in node lists, and also in the XMLDOM selection which is new, this way the nodes can be treated as a single unit or block.

The parser has the capability to extract an illogical set of nodes from the XMLDOM list, and also perform XPATH related queries at the same time within a XML tree on a data set and effectively reference the nodes to the data also deriving information from queries which can be highly sophisticated sometimes.

The parser uses a set of two functions to achieve this and they are the .select Nodes() and .select Single Node(), that will look for the first node on the Xpath query and retrieve the specified selection of nodes related to the node for which the function was called in the first place.

Controlling the Data Views

XML is hierarchical in nature and it looks like an easy task to populate a data tree, but in reality it is not all that easy as it sounds. A nagging problem which shows up invariably while performing this act is that when XML has the ability to show up in a tree view, it isn’t essential that every single in the tree has to show up on the tree. Let us take a typical example of a purchase order. There are definitely a number of ways in which the data in the purchase order can be displayed.

Depending on the requirement you may need to see all the nodes which is present in the XML document and you may have the need to make sure to one hundred percent that the data being shown is authentic and correct to its last bit, but at the same time you may also need a tree view or a tree structure for your data which has to show only the names of all the products that is being purchased and when you select the node, it gives information that is more detailed in appearance.

When XML documents are coded for display purpose they are done directly into the program and it isn’t considered a wise action to follow always. This method makes you recompile the application each time you display and even distribute perhaps which might result in a bigger headache than you actually though it would. This activity needs a lot of coding in DOM which is extensive so that you are able to handle the mapping of both elements and their attributes, which can result in difficulty while managing the interfaces.

Instead of doing all this you might just want to consider, in moving much of your presentation logic and take the help of XSLT style sheet which can easily transform the XML data into a procurable format which is like the easiest way pout of what can turn into a huge mess.

Identifiers are a part of XML structures, but not always. You can reduce your dependency on ID, and their transformation and essentially auto-generating keys handle the determining process for the node and they will perform the function of selecting the node. It is extremely important to follow the same procedure to map the keys to the document source. A statement like select nodes will follow the same procedure to take the source document like it generated the target document and the keys are included in the source node as attached attributes and are in the same order as well, coordinating with each other in an exact manner.

However, the sorting of the document takes place only after the keys are assigned to the document in the first place. Until which the document will not undergo any changes. If this is not done, then the node will not be selected by the auto generating keys which will fail to generate any key because the keys have not been mapped.

The style sheet is usually used to populate the tree in an XML document and also source code can be transformed into a form which can be processed easily unlike the XML document which was brought in raw. When it comes to the new Microsoft extensive markup language parser, the whole process is handled with the help of the agency present in the processor and which uses a style sheet to process.

The function called load filter will take a path to the universal resource locator, and will load the filter into the XML data object model, which will then end up creating a new process model which will be purely based on the style sheet. When compilation is done the transformation which actually took place will look much simpler and a faster process and if the same transformation was done individually than it would seem like a tedious never ending process and also a difficult one.

Actually what has been happening in the background is that the XSLT style sheets have started providing the same functionalities of the Visual basic subroutines. The sub routine is capable of affecting the data which is being presented. XSLT templates can be created to carry out simple tasks such as commanding the source data to begin the process and also perform filtering functions provided it is based upon and is also been included in the XPath queries, so that multiple streams of information can be loaded and viewed which results in combining all the data well before the data is finally presented into the document.

For displaying XML data the SLT can be used as a mechanism that would help you to impose business rules on the XML data. In a scenario where you have the need to process a number of purchase orders and all were compiled into a single large XML stream, you can actually create rules for line items by grouping similar items or specifying for $100 only, irrespective of what the item is. Such rules can be created easily for smart functioning. All these could be achieved using the Visual Basic sub routines and enhanced using the XSLT specification of the XML.

« « C++ Manipulators
NLP Well Formed Outcome Model » »

Author Description

Avatar

Editorial Team at Exforsys is a team of IT Consulting and Training team led by Chandra Vennapoosa.

Free Training

RSSSubscribe 394 Followers
  • Popular
  • Recent
  • XML Disadvantages

    July 8, 2007 - 0 Comment
  • XML Web Services

    July 11, 2007 - 0 Comment
  • XML Introduction

    May 14, 2006 - 0 Comment
  • XML Parsing

    July 14, 2007 - 0 Comment
  • XML – Elements, Attributes, Entities

    May 14, 2006 - 0 Comment
  • XML Processing

    July 16, 2007 - 0 Comment
  • XML – Document Type Definitions (DTD)

    June 14, 2006 - 0 Comment
  • XML Remote Calling Procedure

    July 19, 2007 - 0 Comment
  • XML – Elements in Document Type Definitions (DTD)

    June 14, 2006 - 0 Comment
  • XML Security

    July 21, 2007 - 0 Comment
  • Working with XML in C

    September 7, 2007 - 0 Comment
  • Working with XML in Perl

    September 6, 2007 - 0 Comment
  • Working with XML in Python

    September 2, 2007 - 0 Comment
  • Working with XML in Flash

    August 30, 2007 - 0 Comment
  • Working with XML in Oracle

    August 30, 2007 - 0 Comment
  • Using XML with Microsoft Excel

    August 24, 2007 - 0 Comment
  • XML Spy

    August 24, 2007 - 0 Comment
  • XML and Service Oriented Architecture

    July 25, 2007 - 0 Comment
  • XML SQL Server

    July 23, 2007 - 0 Comment
  • XML Security

    July 21, 2007 - 0 Comment

Exforsys e-Newsletter

ebook
 

Related Articles

  • Working with XML in C
  • Working with XML in Perl
  • Working with XML in Python
  • Working with XML in Flash
  • Working with XML in Oracle

Latest Articles

  • Project Management Techniques
  • Product Development Best Practices
  • Importance of Quality Data Management
  • How to Maximize Quality Assurance
  • Utilizing Effective Quality Assurance Strategies
  • Sitemap
  • Privacy Policy
  • DMCA
  • Trademark Information
  • Contact Us
© 2023. All Rights Reserved.IT Training and Consulting
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT