Solved

XML Import Export (Data Mapper)

Posted on 2004-09-23
7
165 Views
Last Modified: 2010-05-02
We have an application and the database for it is user customisable.  We need to be able to import and export data to various 3rd parties in their specific format.

In essance what we need is for a user to be able to select a .xml or xsd file and then map their fields to that document.
We can then store this "Template" in our database, and the next time they want to import or export an xml file that can just select a the file an a "Template" and it will do the rest for them.

I hope this is clear.

Any clues as to how I could achive this would be a great help.
0
Comment
Question by:sajohnstone
[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
  • 3
7 Comments
 
LVL 10

Accepted Solution

by:
fds_fatboy earned 125 total points
ID: 12133908
Create a view on your DB with the columns that can be selected.

create this table

tblColumn
    ColumnId (PK)
    ColumnName

place a row in it for each of the columns in the view

Create these tables

tblTemplate
    TemplateId (PK)
    templateName

tblTemplateColumn
    TemplateId (FK to  tblTemplate)
    ColumnId (FK to  tblColumn)


Put a textbox and multi-select listbox on a form and populate it with the contents of tblColumn. Allow your customers to enter the name of a template in the textbox and select fields from the listbox. When they save create a new row in tblTemplate and loop through the listbox getting the keys to create rows for tblTemplateColumn.

In anotherform allow the user to select a previously created template. Create a stored procedure to create a dynamic SQL Select statement to get data from the initial view.

Sorry this is sketchy but that's the nest I can do with the information provided.

Now back to work.
0
 

Author Comment

by:sajohnstone
ID: 12134161
Thanks for the response fds_fatboy.

What I need to know is how to do the XML part.  

How to read a xsd/dtd/xml file into a format that could be turned in to a template.
How to then turn that template into an xml file (that matches the dtd/xsd if provided).
How to read a imported xml file against the template and hence map the fields to our database

I can't help thinking there must be an SDK or something out there that does this allready as I imagine that this is a fairly common request.
0
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12134926
Well there's this one from microsoft.

http://msdn.microsoft.com/XML/XMLDownloads/default.aspx

It's very easy to use with VB. Also, if you are using dotNet check out ADO.Net - loads of XML in there - What DB are you using?
0
 
LVL 10

Expert Comment

by:fds_fatboy
ID: 12565157
Well I think we were on the way to a solution but then sajohnstone just buggered off. Looking at his/her profile, 1 question/1 comment not bothering to answer questions. I think he/she is gone for good.

Never mind.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

752 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