Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-04-02
1
Medium Priority
?
1,037 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 2000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

597 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