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

parsing an xml file...

Status
Not open for further replies.

springz33

Technical User
Mar 9, 2004
3
0
0
CA

I'm new to vb and would appreciate some help =)

I created two directories, inbox & outbox. My xml files are stored in the inbox. I need to know how to parse the xml file.

part of the xml file looks like this..

<To:>greg, john</To:>
<From:>sally</From:>
<message>hi</message>

What I need is to grab the information in the 'to:' field and create a directory in the outbox based on the name there as well as moving that file to that created directory. There may be multiple recipients in the to field so a directory would be created for each recipient and the xml file copied to each of their directories.

-thanks
 
And what have you so far ?
Take a look at the FileSystemObject object and the InStr and Split functions.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
so far I just have batch files that will create the directories based on the name of the xml file..i need to know how to create the directories by the information in the 'to:' field of the xml file...

thanks,
 
this piece of asp might help?

Set xml = Server.CreateObject("Microsoft.XMLDOM")

xml.load("c:\yourxml.xml")
Set Root = xml.documentElement
If Root.parsed Then
set ObjField = xml.selectnode("//To"

if objfield.length > 0 then
' Mkdir objfield(0).getattribute("value")
else
retval = ""
end if
Set objfield = nothing
else
retval = ""
end if

Set ObjField= nothing

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top