用ASP的FileSystemObject对象读取文件时出现的错误!!
ASP程序:
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
filePath = Server.MapPath("asp.xml")
Set txtsObj = FSO.OpenTextFile(filePath, 1, false)
Set contentObj = txtsObj.ReadAll()
xmlString = "<?xml version='1.0' encoding='GB2312'?><?xml-stylesheet type='text/xsl' href='xsl.xsl'?>"
Set sString = contentObj.Replace("",xmlString)
Set FSO = Nothing
下面是ASP。XML文件代码
<?xml version="1.0" encoding="GB2312"?>
<?xml-stylesheet type='text/xsl' href='xsl.xsl'?>
<HTT><RESOURCE>
<ITEM NAME="图片资料" LINK="/INFOWEB/ResourceIntro.htm#tpzl"/>
<ITEM NAME="音乐专辑" LINK="/INFOWEB/ResourceIntro.htm#yyzj"/>
<ITEM NAME="电影电视" LINK="/INFOWEB/ResourceIntro.htm#dyds"/>
<ITEM NAME="英语学习" LINK="/INFOWEB/ResourceIntro.htm#yyxx"/>
<ITEM NAME="电子文献" LINK="/INFOWEB/ResourceIntro.htm#dzwx"/>
</RESOURCE>
<DSOURCE>
<ITEM NAME="国研报告" LINK="http://www.drcnet.com.cn/"/>
<ITEM NAME="中国资讯行" LINK="http://www.chinainfobank.com/"/>
<ITEM NAME="中国期刊网" LINK="http://www.cnki.net/index.htm"/>
<ITEM NAME="超星数字图书馆" LINK="http://www.ssreader.com/"/>
<ITEM NAME="维普中文科技期刊全文库" LINK="http://www.tydata.com/"/>
<ITEM NAME="Web of Science" LINK="http://www.isiwebofknowledge.com/index.html"/>
</DSOURCE>
<SERVICE>
<ITEM NAME="检索指南" LINK="Help.htm#js"/>
<ITEM NAME="新用户注册" LINK="Help.htm#zc"/>
<ITEM NAME="用户登录" LINK="Help.htm#dl"/>
<ITEM NAME="查看余额" LINK="Help.htm#ye"/>
<ITEM NAME="数据库选择" LINK="Help.htm#xz"/>
</SERVICE>
<LINKS>
<ITEM NAME="中国国家图书馆" LINK="http://www.nlc.gov.cn/"/>
<ITEM NAME="清华大学图书馆" LINK="http://www.lib.tsinghua.edu.cn/"/>
<ITEM NAME="北京大学图书馆" LINK="http://www.lib.pku.edu.cn/"/>
<ITEM NAME="南京大学图书馆" LINK="http://lib.nju.edu.cn/"/>
<ITEM NAME="中国政府网站" LINK="http://www.edu.cn/xiang_guan_lian_jie/zheng_fu/index.htm"/>
<ITEM NAME="中国公共图书馆" LINK="http://www.edu.cn/HomePage/jiao_yu_zi_yuan/list.php?listid=136"/>
<ITEM NAME="中国大学图书馆" LINK="http://www.edu.cn/HomePage/jiao_yu_zi_yuan/list.php?listid=135"/>
<ITEM NAME="中国高等教育文献保障系统" LINK="http://www.calis.edu.cn/"/>
</LINKS>
<READER>
<ITEM NAME="DIPS阅读器" ICON="IQBook.gif" LINK="IQBook.rar"/><ITEM NAME="DIPS阅读器(OCR)" ICON="IQBook.gif" LINK="IQBook(ocr).rar"/><ITEM NAME="PDF阅读器" ICON="pdf.gif" LINK="ar60chs.rar"/><ITEM NAME="Media Player 9" ICON="icon_mplay.gif" LINK="mpsetup.rar"/><ITEM NAME="RealPlayer 10.5" ICON="icon_real.gif" LINK="RealPlayer10.5_GOLD.rar"/><ITEM NAME="Flash Player 8.0" ICON="icon_swf.gif" LINK="install_flash_player_active_x.rar"/></READER>
<CanSelected>true</CanSelected>
<CertWay>3</CertWay>
<Lid>dips</Lid>
<llp>1</llp>
<CertCenter>
<Item Aid="uas" Url="http://www.auth.calis.edu.cn" DefaultSvr="true"/>
<Item Aid="CALIS武汉认证中心" Url="http://www.auth.caliswh.edu.cn" DefaultSvr="false"/>
<Item Aid="CALIS西南认证中心" Url="http://www.auth.calisxn.edu.cn" DefaultSvr="false"/>
</CertCenter>
<CertServiceUrl>/amserver/AuthServices</CertServiceUrl>
</HTT>
调试时报的错误
Microsoft VBScript 编译器错误 错误 '800a03f6'
缺少 'End'
/iisHelp/common/500-100.asp,行242
Microsoft VBScript 运行时错误 错误 '800a01a8'
缺少对象: '[string: "<?xml version="1.0" "]'
/TEST/xml/xml/READER_Original.asp,行4