Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

XML Import Export (Data Mapper)

Posted on 2004-09-23
7
Medium Priority
?
169 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 500 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

730 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