ASP生成XML后用FLASH读取的问题

idhgd 2010-03-31 11:07:40
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Inc/Top.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>无标题文档</title>
</head>

<body>
<%xmlfile=server.mappath("/case/amline.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0""?>")
MyFile.WriteLine("<main>")
%>

<%sql_ad1="select * from lanmu where bigclass=37 order by nb"
Set rs_ad1= Server.CreateObject("ADODB.Recordset")
rs_ad1.open sql_ad1,conn,1,1
do while not rs_ad1.eof
%>
<%MyFile.WriteLine "<dept name=""" & rs_ad1("lmname") & """>" %>
<%sql_ad2="select * from Img where class2=38"
Set rs_ad2= Server.CreateObject("ADODB.Recordset")
rs_ad2.open sql_ad2,conn,1,1
do while not rs_ad2.eof
%>
<%MyFile.WriteLine "<city>"%>
<%MyFile.WriteLine "<point name="""&rs_ad2("title")&""" url=""caseimg.asp?ID="&rs_ad2("id")&""" />"%>
<%MyFile.WriteLine "</city>"%>

<%
rs_ad2.movenext
loop
rs_ad2.close
set rs_ad2=nothing
%>
<%MyFile.WriteLine "</dept>"%>
<%
rs_ad1.movenext
loop
rs_ad1.close
set rs_ad1=nothing
%>
<%MyFile.WriteLine "</main>"%>
<%

MyFile.close '关闭fout
set MyFile=nothing '清空fout
set fso=nothing
%>
</body>
</html>


我用以上代码或者编码encoding="ISO10646“生成XML文件,然后用FLASH读取就不可以。但我用DREAMWEAVER打开后修改其中的一个汉字,然后再直接保存就可以读取了。 试着用encoding="GB2312"生成的修改了某个汉字还是不可以读取。是什么原因呢?我要怎样才能使生成的文件可以直接用FLASH读取?
...全文
127 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
idhgd 2010-04-30
  • 打赏
  • 举报
回复
楼上是正解。
cds27 2010-04-07
  • 打赏
  • 举报
回复
flash设置useCodepage = true
gclwlq 2010-04-03
  • 打赏
  • 举报
回复
我也试了,全是乱码,怎么回事?
idhgd 2010-03-31
  • 打赏
  • 举报
回复
找到原因了。

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧