From time to time, my web host changes some aspect of the server that this weblog is hosted on. The code that runs this site is written in classic ASP which means it is hosted on IIS. Recently another configuration change took place, presumably one of Microsoft's many hot fixes or an upgrade to a new version of Windows or IIS.
The following error started to appear tagged onto the bottom of every web page:
msxml3.dll error '80004001' Not implemented
Behind the scenes, this site use XML and XSL to separate the site's data from its layout, in the middle somewhere is a line of code which performs an XSLT transformation on the XML DOM into the HTML output which gets squirted out into the response.
' method to transform the response (with errors)
public sub TransformToResponse_Old(xml, xsl)
xml.transformNodeToObject xsl, Response
end sub
Somewhere in the depths of ASP or IIS, a change has occurred which has dropped the IStream support of the classic ASP response object (I presume looking at the symptoms).
The fix introduces an intermediate stream to receive the XSLT transformation, and then send that to the response. This method also sets the response code page to be UTF8, which this site uses.
' method to transform the response (without errors)
public sub TransformToResponse_New(xml, xsl)
' By Tim Hastings, www.nonhostile.com
' prepare stream to receive transformation
dim outputStream
Set outputStream = Server.CreateObject("ADODB.Stream")
outputStream.Open
outputStream.Charset = "UTF-8"
outputStream.Type = 1 ' adTypeBinary
' transform and output to stream
xml.transformNodeToObject xsl, outputStream
' set character-set
Response.CharSet = "UTF-8"
Response.ContentType = "text/html"
Session.CodePage = 65001
' rewind the stream and send to response
outputStream.Position = 0
Response.BinaryWrite outputStream.Read()
' finished with the stream
outputStream.Close
set outputStream = Nothing
end sub
The code that runs this site is written in classic ASP which means it is hosted on IIS.该代码运行这个网站是用在传统的ASP这意味着它是在IIS托管。 Recently another configuration change took place, presumably one of Microsoft's many hot fixes or an upgrade to a new version of Windows or IIS.最近,另一个配置发生变化,可能是微软的许多热修复或到Windows或IIS一个新的版本升级。
The following error started to appear tagged onto the bottom of every web page:下面的错误开始出现走上每个网页底部的标签:
msxml3.dll error '80004001' msxml3.dll的错误'80004001' Not implemented未实施
Behind the scenes, this site use XML and XSL to separate the site's data from its layout, in the middle somewhere is a line of code which performs an XSLT transformation on the XML DOM into the HTML output which gets squirted out into the response.在幕后,本网站使用XML和XSL分开网站的数据的布局在中间,是一个地方的代码行的执行一个基于XML DOM的HTML输出到它获取喷入反应进行XSLT转换。
' method to transform the response (with errors) '方法来改变反应(有错误)
public sub TransformToResponse_Old(xml, xsl) 公众分 TransformToResponse_Old(的XML,XSL)
xml.transformNodeToObject xsl, Response xml.transformNodeToObject样式,反应
end sub 结束分
Somewhere in the depths of ASP or IIS, a change has occurred which has dropped the IStream support of the classic ASP response object (I presume looking at the symptoms).在某处或IIS的ASP,一个已发生的已放弃了传统的ASP Response对象的IStream支持改革的深度(我相信看的症状)。
The fix introduces an intermediate stream to receive the XSLT transformation, and then send that to the response.此修复程序引入了一个中间流接收XSLT转换,然后发送,为了响应。 This method also sets the response code page to be UTF8, which this site uses.此方法还设置响应代码页是UTF8的,本网站使用。
' method to transform the response (without errors) '方法来改变反应(没有错误)
public sub TransformToResponse_New(xml, xsl) 公众分 TransformToResponse_New(的XML,XSL)
' By Tim Hastings, www.nonhostile.com '作者:Tim黑斯廷斯,www.nonhostile.com
' prepare stream to receive transformation '准备接收流改造
dim outputStream 暗淡的OutputStream
Set outputStream = Server.CreateObject( "ADODB.Stream" ) 设置的OutputStream = Server.CreateObject(“的ADODB.Stream”)
outputStream.Open outputStream.Open
outputStream.Charset = "UTF-8" outputStream.Charset =“UTF - 8的”
outputStream.Type = 1 ' adTypeBinary outputStream.Type = 1'adTypeBinary
' transform and output to stream '转换和输出流
xml.transformNodeToObject xsl, outputStream xml.transformNodeToObject样式,OutputStream中
' set character-set '设置字符集
Response.CharSet = "UTF-8" Response.CharSet =“UTF - 8的”
Response.ContentType = "text/html" Response.ContentType =“文本/ HTML”
Session.CodePage = 65001 Session.CodePage = 65001
' rewind the stream and send to response '绕流和发送的反应
outputStream.Position = 0 outputStream.Position = 0
Response.BinaryWrite outputStream.Read() Response.BinaryWrite outputStream.Read()
' finished with the stream '完成与流
outputStream.Close outputStream.Close
set outputStream = Nothing 没有设置的OutputStream =
end sub 结束分