Groups | Blog | Home
all groups > dotnet xml > june 2007 >

dotnet xml : XML data into MDB file


Preeti
6/22/2007 3:36:24 AM
Hi all

I am a newbie in xml.

I have a requirement where I have a predefined XML files and I want to
add the data in these file to into Access mdb through my application

The xml structure is fixed and I hav eto implement a button which on
click submit the data to the mdb file without any further intervention
from user.

My problems are ::

1) Since xml file structure is fixed but it can have multiple nested
elements in different files, the database in MDB should be relational.
I dont know how I can achieve this. How will I maintain multiple
tables in the target database??

for example ::

one file may contain blank data like this
<images>
</images>

and another xml file may contain

<images>
<imagename>
<caption></caption>
</imagename>
<imagename>
<caption></caption>
</imagename>
</images>

2) If in future the xml file is changed I will have to change my
application also.. I want to avoid this. Is there any way in which I
can make my application handle minor changes in xml structure
automatically ?? ( for instance adding fields in database dynamically
if new field is found in xml )

can anyone help??

Regards
Preeti
clintonG
7/5/2007 9:15:55 PM
Better late than never so I hope you're still watching for a reply.

The best advice I can give you is to use Google to search for articles that
document how to "shred" data into the database. The term shredding is what
the process is called. You'll probably have to learn XPath as well.

For XML elements that have nested elements or when the elements contain
attributes you'll have to use foreign keys to relate to another table.
Create a column for all possible nested element or attribute values and when
an element or attribute is not used write NULL into the column.

To respond to change is a hassle and will require learning to use ADOX to
modify the structure of tables in an mdb file which is what I used with ASP
noting I'm not sure if this continues to pertain when using ASP.NET.
Whatever, I'm sure there's a way to use the framework to modify tables.

<%= Clinton

[quoted text, click to view]

AddThis Social Bookmark Button