Solved

convert tab-delimited text file to XML based on a schema

Posted on 2009-04-02
1
961 Views
Last Modified: 2012-05-06
I have a tab-delimited text file for a client that is filled with data.  A customer gave us an .XSD file for the schema of an XML file.  They want us to convert the tab-delimited data text file to an XML file based on the schema they gave us.  And of course, the schema has extra field names, and some of them are different than ours.

How can we do this?  Is there an open-source solution?  We are VB.NET/SQL programmers here.  We just want to take the text file we normally send them and convert it to an XML file based on the schema they gave us.  I'm kind of new to XML! :)
0
Comment
Question by:redmission
1 Comment
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 24054219
I don't think you'll find any off-the-shelf way to do this, you're going to have to do it in code.

There's a sample of converting a CSV file to XML using transforms located at http://www.thescarms.com/dotnet/XSLT.aspx. It probably wouldn't be too tough to modify the XSLT file to work with your tab-delimited source file. The approach used by this solution is a nice one because if you have another customer that wants XML, but wants it in a slightly different format, you can just create another XSLT for that customer. Then, in your database, keep track of which XSLT you need to load and use for that customer (or store the XSLT itself in the database).
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now