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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML import do not call list

Status
Not open for further replies.

ghornet

Programmer
Dec 18, 2003
2
US
Well I seem to be a gomer when trying to understand XML. Could some one please help me? I am trying to write a script or DTS package that will read 4 XML files (Do not call list) compare each phone number to the numbers I have in my DB and if there is a match put the contactID in to another table. Or at the very least get the XML phone numbers into the database. This is what the XML doc looks like

- <list type=&quot;full&quot; level=&quot;state&quot; val=&quot;AL&quot;>
- <ac val=&quot;205&quot;>
<ph val=&quot;2025896&quot; />
<ph val=&quot;2061994&quot; />
<ph val=&quot;2061995&quot; />
<ph val=&quot;2062028&quot; />

 
Just what is it that you don't understand?

Strip away the header line and all the XML decorations and what's left? An area code and a list of phone numbers. How would you get that into your database?
 
First off, if I strip away the XML decorations I have a very large text file.. and I would prefer to do this in XML.. it is faster yes?

I don't understand how to get XML data into a sql server database, Do I write and XLS file, if I do how do I format it? Do I write a VBS script? can I do it in asp.net? Is it a combo of all of these?

D--
 
The question was rhetorical. XML faster? Probably not.

You need to parse the XML file, using either a SAX or DOM parser. In this case, a SAX parser seems to make more sense, as there doesn't appear to be any need to load the whole XML tree into memory.

You're apparently on a MS platform. Check this out:
and look for the tip on converting the samples to VBScript.

HTH
--harebrain
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top