用户提问
如题
推荐答案
方法一,数据绑定
XML文件
Empire BurlesqueBob Dylan
USA
Columbia
10.90
1985
Hide your heartBonnie Tylor
UK
CBS Records
9.90
1988
Greatest HitsDolly Parton
USA
RCA
9.90
1982
Still got the bluesGary More
UK
Virgin redords
10.20
1990
ErosEros Ramazzotti
EU
BMG
9.90
1997
HTML文件
xmldso.XMLDocument.load("myfile.xml");
function movenext()
{
if (xmldso.recordset.absoluteposition < xmldso.recordset.recordcount)
{
xmldso.recordset.movenext();
}
}
function moveprevious()
{
if (xmldso.recordset.absoluteposition > 1)
{
xmldso.recordset.moveprevious();
}
}
CD NavigateCLASSID="clsid:550dda30-0541-11d2-9ca9-0060b0ec3d39" ID="xmldso">
Title: | |
Artist: | |
Year: | |
Country: | |
Company: | |
Price: |
方法二:
一.下面先建立一个xml文档myxml。myfile为根元素,它包含四个字元素:
xml实用进阶魅力奇异岭
zhyt710@tom.com
20060423
二.在建立一个html文档myhtm,用来调用上面建立的xml文档,注意其中javascript的使用。例程如下:
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.load("myxml.xml");
nodes = xmlDoc.documentElement.childNodes;
title.innerText = nodes.item(0).text;
author.innerText = nodes.item(1).text;
email.innerText = nodes.item(2).text;
date.innerText = nodes.item(3).text;
在HTML中调用XML数据标题:
作者:
电子信箱:
日期:
把两者放在同一个目录下,你就可以打开myhtm.htm来察看myxml.xml的信息了
辅助答案
用户:1310652622
2018年04月05日
可以用关联XSL的方法去编写执行一个HTML文件
用户:陌生的羁绊2014
2018年05月10日
XML:(eXtensible Markup Language) 扩展标记语言,主要用于信息配置和小数据的网络传输
HTML:超文本标记语言,主要负责页面的静态展示
XML是一种静态语言,无法连接html文件
用户:骨感de生活
2018年04月17日
xml是地图页或是rss页面的 后台生成xml文件后里面就都有html的文件了
用户:销售代表
2018年05月07日
xml和html都同属于标记语言,不会有任何行为上的作用。