求一段 asp修改xml代码
求一个asp修改xml节点的代码。。。详细一点的谢谢了,,,,就是下边这个xml文件,修改里边的url和caption的内容。<%=rs("images")%>这个是获取...
求一个asp修改xml节点的代码。。。详细一点的谢谢了,,,,
就是下边这个xml文件,修改里边的url 和 caption 的内容。<%=rs("images")%> 这个是获取的上传图片的地址,,,用他替换了url里边的东西,,,
<?xml version="1.0" encoding="UTF-8"?>
<gallery frameColor="0xFFFFFF" frameWidth="15" imagePadding="20" displayTime="6" enableRightClickOpen="true">
<image>
<url>images/tall.jpg</url>
<caption><![CDATA[<font size="50">Example Gallery</font><br>An example large format <u><a href=" http://www.airtightinteractive.com/projects/autoviewer">AutoViewer</a></u> gallery.]]></caption>
<width>700</width>
<height>465</height>
</image>
<image>
<url>images/tall.jpg</url>
<caption>Pellentesque turpis leo, dignissim ac, vestibulum quis, hendrerit quis, enim.</caption>
<width>465</width>
<height>700</height>
</image>
</gallery> 展开
就是下边这个xml文件,修改里边的url 和 caption 的内容。<%=rs("images")%> 这个是获取的上传图片的地址,,,用他替换了url里边的东西,,,
<?xml version="1.0" encoding="UTF-8"?>
<gallery frameColor="0xFFFFFF" frameWidth="15" imagePadding="20" displayTime="6" enableRightClickOpen="true">
<image>
<url>images/tall.jpg</url>
<caption><![CDATA[<font size="50">Example Gallery</font><br>An example large format <u><a href=" http://www.airtightinteractive.com/projects/autoviewer">AutoViewer</a></u> gallery.]]></caption>
<width>700</width>
<height>465</height>
</image>
<image>
<url>images/tall.jpg</url>
<caption>Pellentesque turpis leo, dignissim ac, vestibulum quis, hendrerit quis, enim.</caption>
<width>465</width>
<height>700</height>
</image>
</gallery> 展开
展开全部
<%
xmlfile=server.mappath("gallery.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""gb2312""?>")
MyFile.WriteLine("<gallery>")
sql="select * from pro where cate="&request("id")&" order by times desc"
rs.open sql,conn,1,1
if not rs.eof then
n=0
do while not rs.eof
n=n+1
MyFile.WriteLine("<image>")
MyFile.WriteLine("<url>"& rs("image") &"</url>")
MyFile.WriteLine("<caption><![CDATA[<font size=""30"">"& rs("name") &"</font>]]></caption>")
MyFile.WriteLine("<width>"&W&"</width>")
MyFile.WriteLine("<height>"&H&"</height>")
MyFile.WriteLine("</image>")
if n mod 4=0 then
response.Write("</image>")
end if
rs.movenext
loop
end if
rs.close
MyFile.WriteLine("</gallery>")
MyFile.Close
%>
欧了,自己看吧,有啥不懂得再问我
xmlfile=server.mappath("gallery.xml")
Set fso = CreateObject("Scripting.FileSystemObject")
Set MyFile = fso.CreateTextFile(xmlfile,True)
MyFile.WriteLine("<?xml version=""1.0"" encoding=""gb2312""?>")
MyFile.WriteLine("<gallery>")
sql="select * from pro where cate="&request("id")&" order by times desc"
rs.open sql,conn,1,1
if not rs.eof then
n=0
do while not rs.eof
n=n+1
MyFile.WriteLine("<image>")
MyFile.WriteLine("<url>"& rs("image") &"</url>")
MyFile.WriteLine("<caption><![CDATA[<font size=""30"">"& rs("name") &"</font>]]></caption>")
MyFile.WriteLine("<width>"&W&"</width>")
MyFile.WriteLine("<height>"&H&"</height>")
MyFile.WriteLine("</image>")
if n mod 4=0 then
response.Write("</image>")
end if
rs.movenext
loop
end if
rs.close
MyFile.WriteLine("</gallery>")
MyFile.Close
%>
欧了,自己看吧,有啥不懂得再问我
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询