Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Parsing xml document into table

Status
Not open for further replies.

Tarnish

Technical User
Nov 13, 2006
221
US
Hi all,

I'm looping through a folder and pulling xml files (one at a time, obviously) into a variable in a procedure in vba. I've tried importing the xml files but each file produces multiple tables and the tables simply don't work well together. I've also tried applying a transformation file and that doesn't seem to fix the table issue, either, though I don't really know what my goal is with the transformation. I can create the table easily in terms of using a transformation to turn the xml into a nice html table, but that table does not show up when I import it.

So I pull all the text from one of these files into a variable, and I need to go through the text systematically and pull out pieces to form a table record and append that record to (most likely) an existing table. In most cases there will be multiple records pulled out of each file.

I have searched for pieces of information in the past in vba using string functions and pulled that out without any problem, but the difference here is I need pull text from between an opening and closing xml tags, save it to a variable, then move forward in the text file and go to the next place and pull that data out (again, data between opening and closing xml tags).

Can someone give me an idea of what to use to work with a text file in this manner? I've done perl to create rss feeds from web pages in the past and it seems like that's the kind of process I need, I just don't know what to use in vba.

Thanks for any help,
T
 
-Thanks for the replies.

When I import the actual xml file, access (2003) ends up making like 5 or 6 tables out of it and the tables don't seem to relate to each other very well in terms of me being able to look at them and see any common field I could use as a pk.

I'll look at the suggestions. I have a feeling it probably will be easier for me to just convert the xml files to a text extension and import them as text and try to loop through them and get the info I need...

Thanks again,
T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top