回复 9# 447219071
既然你的服务器支持asp,最简单的写法:
test.asp- <%
- k = Request.QueryString("k")
- xmlFile = Server.MapPath(k & ".xml")
-
- Set xmlDoc = Server.CreateObject("Microsoft.XMLDOM")
- xmlDoc.load(xmlFile)
- title = xmlDoc.getElementsByTagName("title")(0).text
- %>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title><%=title%></title>
- </head>
- <body>
- <h1><%=title%></h1>
- <p>This is a simple HTML5 page with the title from <%=k%>.xml.</p>
- </body>
- </html>
复制代码 1.xml- <?xml version="1.0" encoding="UTF-8"?>
- <root>
- <title>This is the title</title>
- </root>
复制代码 两个文件放到服务器上就可以访问test.asp?k=1 |