|
-
Aug 3rd, 2000, 04:40 AM
#1
Thread Starter
New Member
Hello,
I'm writing this program to parse XML files and take the data out and put it into an SQL database. The XML is not
very well formatted. It has "&" and I have to use a replace function to put in "&". I use the FileSystemObject to load the file with .GetFile. After I do the replacing I need to Save the File. Coming from the ASP world I was amazed when I couldn't simply resave the file after doing this replacing. I have to becuase the parser takes the name of the XML file to be parse and not the object that contains the file. I suppose I could create a new file and use the TextStream to rewrite it line by line. This seems like a lot of extra hassle.
Any help very much appreciated.
sample
Function ReplaceAmp(strString)
If InStr(Trim(strString), "&") > 0 Then
ReplaceAmp = Replace(Trim(strString), "&", "&", 1, -1, 1)
Else
ReplaceAmp = strString
End If
End Function
Set objArticles = CreateObject("Scripting.FileSystemObject")
Set objFile = objArticles.GetFile("K:\general\news\msb-iij\ukm19-06-2000.xml")
cleanXML = ReplaceAmp(objFile)
cleanXML.Save 'this is what I assumed would work
MsgBox ("hello")
Thanks,
Tantulus
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|