all groups > dotnet xml > january 2004 >
You're in the

dotnet xml

group:

Suggestions on Importing XML Document



Suggestions on Importing XML Document R Jones
1/29/2004 10:57:39 PM
dotnet xml: All,

I'm trying to automate the import of an XML document into an Access
application. Unfortunately Access cannot properly read the document. When
it attempts to bring in the document it creates partial data structures and
does not import any data.

I have tried to bring this document into Visual Studio .NET but it also
errors out. The issue being the document uses nested elements, and these
elements are interpreted as tables and it bungs up VS.NET. (This is a
confirmed bug by Microsoft with no work arounds offered:
http://support.microsoft.com/default.aspx?scid=kb;en-us;325696
)

So, ok, now the question is where do I start? Is there a third party
product I can call from Access that may be able to parse this file? Do I
have to write my own parser? Any suggestions would help.

And, PS, I have NO control over the creation of this XML document, so I
can't go to the source and ask for a Microsoft friendly XML formatted
document.

Suggestions?
Thanks,
Rick


Re: Suggestions on Importing XML Document Daniel Cazzulino
1/30/2004 3:25:25 PM
The "easy" way is to just go through an XmlTextReader and pull the
information you need.
You can build a dataset by hand and pass it to a DataAdapter.Update(), or
you can directly perform the insert using an OleDbCommand.
Personally, I think the "bug" you mention is not such. It's a limitation of
trying to make an XML document fit in a table-like structure like the
Dataset, nothing more. The same problem you would face if you try to put
fairly complex XSD types into .NET classes.


--
Daniel Cazzulino
Lagash Systems SA
http://weblogs.asp.net/cazzu


[quoted text, click to view]

AddThis Social Bookmark Button