Advertisement

07.17.2008 at 02:38PM PDT, ID: 23575047
[x]
Attachment Details

Create Formatted Text or Array from XML Input Using Visual Basic

Asked by kanguish in Microsoft Visual Basic.Net, Visual Studio 2008

Tags: Visual Basic Within Visual Studio 2008

I've got a situation where I need to sort data from an XML file into either an array or a flat text file, so that I can perform operations on the data after that.  It is important that the result calculations be done in a specific order, sometimes based on a repeating attribute that is not always present (when the attribute is present, I need to use it, otherwise, I use the value I've saved from the prior day). I need to do this job in as small a package as possible, because I don't want to require my customers to, in the end, need more than Excel and this VB executable that I want to build in Visual Basic.  Keep in mind that the actual xml file will be much larger than Excel can handle; thus, the VB program to arrange the data before the calcs are done.  From the sample file, assume that I want to end up with a single line for each "DataMessage" and that I wish to sort the data by Business Date, Location, Department, and Type.  Note that Type="4" is not always present.  When it is present, I want to use it.  If creating a formatted file, I want a fixed amount of blank space where it would have been, if creating a text file.  The question here is simply: how do I create the formatted text from the xml file, without requiring XSLT, etc?Start Free Trial
Attachments:
 
Small Sample of XML Data to Format and Sort
 
 
 
[+][-]07.18.2008 at 11:31AM PDT, ID: 22038485

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.23.2008 at 04:53PM PDT, ID: 22075001

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.27.2008 at 01:30AM PDT, ID: 22097687

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual Basic.Net, Visual Studio 2008
Tags: Visual Basic Within Visual Studio 2008
Sign Up Now!
Solution Provided By: vbturbo
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628