xml & xsl

chenzhr 2004-11-04 03:06:12
我有两个文档A.XML与A.XSL
如何将生成A.HTML??
...全文
132 9 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
lijinktg 2004-12-10
  • 打赏
  • 举报
回复
up
confidence26 2004-12-07
  • 打赏
  • 举报
回复
<xsl:output method="html"/>
chenzhr 2004-11-08
  • 打赏
  • 举报
回复
接分
saucer 2004-11-06
  • 打赏
  • 举报
回复
1. if you want to do the transformation on the client side, then add a line to A.xml:

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="A.xsl" ?>
...

then request A.xml in your browser. You could also do the transformation using scripting, see
http://www.webreference.com/js/tips/011223.html


2. if you want to do the transformation on the server side, you can do

<%@ Import Namespace="System.Xml.XPath" %>
<%@ Import Namespace="System.Xml.Xsl" %>

<script language="C#" runat="server">
void Page_Load(Object sender, EventArgs e)
{
XPathDocument xmldoc = new XPathDocument(Server.MapPath("A.xml"));
XslTransform xsldoc = new XslTransform();
xsldoc.Load(Server.MapPath("A.xsl"));

xsldoc.Transform(xmldoc, null, Response.OutputStream, null);
}
</script>
19820911 2004-11-05
  • 打赏
  • 举报
回复
XSL可以自动把XML转换为HTML
19820911 2004-11-05
  • 打赏
  • 举报
回复
XSL如何实现循环
Alden 2004-11-04
  • 打赏
  • 举报
回复
XSL可以自动把XML转换为HTML
BearRui 2004-11-04
  • 打赏
  • 举报
回复
XSL文件可以自动把XML转为HTML显示的,看看现在CSDN这个XML贴就是一个狸子!!!
dy_yong 2004-11-04
  • 打赏
  • 举报
回复
去查一下数据岛问题,就可以看到例子

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

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