How do I remove a line from incoming XML FILE

Discussion in 'ASP General' started by Girish, Feb 17, 2004.

  1. Girish

    Girish Guest

    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
     
    Girish, Feb 17, 2004
    #1
    1. Advertisements

  2. Girish

    Mark Schupp Guest

    What error message do you get in the browser?
     
    Mark Schupp, Feb 17, 2004
    #2
    1. Advertisements

  3. Girish

    Mark Schupp Guest

    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?
     
    Mark Schupp, Feb 18, 2004
    #3
  4. Girish

    Girish Guest

    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!
     
    Girish, Feb 18, 2004
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.