<% ' Pull the remote XNL ... This works fine... Dim fs, fname Dim srcFile srcFile = "http://www.historictours.com/trusted-tours/trustedtours.xml" 'srcFile = "http://trustedtours.com/xml/pstore01.xml" 'Nothing Below Here Has To Change Response.Buffer = True Dim objXMLHTTP, xml ' Create an xmlhttp Object and Get it! Set xml = Server.CreateObject("Microsoft.XMLHTTP") xml.Open "GET", srcFile, False xml.Send ' xml can now be accessed using -> xml.responseText It's been checked at this stage and it's all there. set fs=Server.CreateObject("Scripting.FileSystemObject") set fname=fs.CreateTextFile("C:\websites\historictours_com\trusted-tours\xml\incoming.xml",true,false) Function cleanse (mstr) len_mstr = len(mstr) for x = 1 to len_mstr ch = mid(mstr, x, 1) if (asc(ch) > 127 ) Then ostr = ostr & " " else ostr = ostr & ch 'if (asc(ch) > 127 ) Then replace(mstr, ch, " ") Next cleanse = mstr End function 'fname.WriteLine ("Wassup!") 'fname.WriteLine(xml.responseText) ' first I was trying to write the whole block directly to a file ' and only part of it was in the file. 'Response.write (xml.responseText) fred = xml.responseText fred = replace(fred , chr(175), " ") ' repace registred trademark symbols ... seee if replace is much faster arrLines = split(fred, vbCrLF) 'Set objFile=objFSO.CreateTextFile(strFilePath) For x=0 To UBound(arrLines) ' If (iLineNumber-1)=x Then objFile.WriteLine(strData) 'Response.write "
-> Writing line: " & cStr(x) & arrLines(x) ' DIAGNOSTIC ->The correct line count prints out as the file is executing... fname.WriteLine(arrLines(x)) Next ' However, the resulting file is truncated exactly as it was when writing the whole thing as a chunk. Set xml = Nothing fname.Close set fs = Nothing set fname = Nothing %> Untitled Document