Following is the code fragment giving me trouble.
' ***** begin fragment *****
Private Const conOverwriteExistingFile = True ' for CreateTextFile & Copy
Private Const conASCIIformat = 0 ' for OpenAsTextStream
set doc = CreateObject("Msxml2.DOMDocument.3.0" ' "Version dependent rental-threaded" model
doc.validateOnParse = false
doc.async = false
doc.load(CStr(FileName))
set xslDoc = CreateObject("Msxml2.DOMDocument.3.0"
xslDoc.async = false
xslDoc.load(StyleSheetPath)
Set fso = CreateObject("Scripting.FileSystemObject"
Set fHtml = fso.CreateTextFile(xslOutputName, conOverwriteExistingFile, conASCIIformat)
strHtmlTempString = doc.transformNode(xslDoc)
wscript.echo "'Len(strHtmlTempString)' = '" & Len(strHtmlTempString) & "'"
wscript.echo "'strHtmlTempString' = '" & strHtmlTempString & "'"
fHtml.Write strHtmlTempString
fHtml.close
set fHtml = nothing
' ***** end fragment *****
Initially, "fHtml.Write doc.transformNode(xslDoc)" was all one line. Upon receiving the VBScript runtime error "Invalid procedure call or argument" on this line, I split it into two steps & found I am receiving this runtime error on the "write" method.
I added the "wscript.echo" to confirm that I am getting HTML in "strHtmlTempString". I am. It is 7,681 bytes. Only one of dozens of "xml" files I have run through the script gives the run-time error. The successfully-processed files range in size from "1" to "159" kilobytes, so I don't think that string length is an issue.
Anyone have any ideas what else to check?
Thanks, Bill
william.g.starr@cummins.com
812-377-6212
Monday, 8 October 2001, 5:04pm EST
' ***** begin fragment *****
Private Const conOverwriteExistingFile = True ' for CreateTextFile & Copy
Private Const conASCIIformat = 0 ' for OpenAsTextStream
set doc = CreateObject("Msxml2.DOMDocument.3.0" ' "Version dependent rental-threaded" model
doc.validateOnParse = false
doc.async = false
doc.load(CStr(FileName))
set xslDoc = CreateObject("Msxml2.DOMDocument.3.0"
xslDoc.async = false
xslDoc.load(StyleSheetPath)
Set fso = CreateObject("Scripting.FileSystemObject"
Set fHtml = fso.CreateTextFile(xslOutputName, conOverwriteExistingFile, conASCIIformat)
strHtmlTempString = doc.transformNode(xslDoc)
wscript.echo "'Len(strHtmlTempString)' = '" & Len(strHtmlTempString) & "'"
wscript.echo "'strHtmlTempString' = '" & strHtmlTempString & "'"
fHtml.Write strHtmlTempString
fHtml.close
set fHtml = nothing
' ***** end fragment *****
Initially, "fHtml.Write doc.transformNode(xslDoc)" was all one line. Upon receiving the VBScript runtime error "Invalid procedure call or argument" on this line, I split it into two steps & found I am receiving this runtime error on the "write" method.
I added the "wscript.echo" to confirm that I am getting HTML in "strHtmlTempString". I am. It is 7,681 bytes. Only one of dozens of "xml" files I have run through the script gives the run-time error. The successfully-processed files range in size from "1" to "159" kilobytes, so I don't think that string length is an issue.
Anyone have any ideas what else to check?
Thanks, Bill
william.g.starr@cummins.com
812-377-6212
Monday, 8 October 2001, 5:04pm EST