How do I remove a line from incoming XML FILE

G

Girish

I have this XML FILE where I am reading data from and it has this node
doctype "< ! D O C T Y P E a d f S Y S T E M " h t t p : / / w h o s c
a l l i n g . c o m / d t d / a d f d t d . d t d " > "

ONLY When I remove this line I could display the data onto the browser, any
ideas WHY? if not I am using following code to remove the above line, it
doesn't work

Dim FindWhat, ReplaceWith

'dim MyString
'MyString= "Hello" & chr(34) & "World" & chr(34) & "World"

FindWhat = "< ! D O C T Y P E &nbsp;&nbsp;a d f &nbsp; S Y S T E M &nbsp;
" & chr(34) & " h t t p : / / w h o s c a l l i n g . c o m / d t d / a d f
d t d . d t d " & chr(34) & "&nbsp;>"
'FindWhat = FindWhat & " h t t p : / / w h o s c a l l i n g . c o m / d t
d / a d f d t d . d t d "
'FindWhat = FindWhat & ">"

response.write "FindWhat :" & FindWhat & "<br>"

ReplaceWith = ""

Dim fso, sText, fs, DestinationFile, writingFile, sPath
set fso = createobject("scripting.filesystemobject")
sPath = "D:\inetpub\PennyFlyer\carmartnew\business_ivr.xml"

if fso.FileExists(sPath) then

Set fs = fso_OpenTextFile(sPath)
sText = fs.ReadAll()

'response.write "sText" & sText

sText = Replace(sText, FindWhat, ReplaceWith)

DestinationFile = "D:\inetpub\PennyFlyer\carmartnew\newbusiness_ivr.xml"

Set writingFile = fso.CreateTextFile(DestinationFile,true,false)

WritingFile.Write(sText)

WritingFile.Close
end if

Thanks
 
M

Mark Schupp

Your attachment opens and displays just fine in IE on my system.

If you are just having problems reading it in and re-writing it why don't
you open it and re-save it with the MSXML component instead of the file
system object?
 
G

Girish

u mean that node is not giving problem, r u reading its data via ASP and
displaying it? if yes, please send me some sample and / or URL on MSXML
component please...

Thanks much!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top