一个xml 文档,我想要提取标签 filename的属性值 该如何操作
<?xmlversion="1.0"encoding="utf-8"?><files><filefilename="轻音乐.ts"address="rtsp://192....
<?xml version="1.0" encoding="utf-8"?>
<files>
<file filename="轻音乐.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="" permission="2"/>
<file filename="SHE我爱你.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="3132333435363738" permission="1"/>
<file filename="老男孩.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="11121314715161718" permission="1"/>
<file filename="汪峰-春天里.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="4142434445464748" permission="1"/>
<file filename="爱的供养.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="5152535455565758" permission="0"/>
<file filename="周杰伦十年.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="6162636465666768" permission="0"/>
</files> 展开
<files>
<file filename="轻音乐.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="" permission="2"/>
<file filename="SHE我爱你.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="3132333435363738" permission="1"/>
<file filename="老男孩.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="11121314715161718" permission="1"/>
<file filename="汪峰-春天里.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="4142434445464748" permission="1"/>
<file filename="爱的供养.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="5152535455565758" permission="0"/>
<file filename="周杰伦十年.ts" address="rtsp://192.168.59.1:8554/mpeg2TransportStreamTest" key="6162636465666768" permission="0"/>
</files> 展开
展开全部
可以用doc文档解析在网页中显示!
用javascript脚本在dreamweaver中!
<script language="javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false"; //禁止异步操作
xmlDoc.load("xmlFileName"); //载入你的xml文档
list = xmlDoc.getElementsByTagName("file");
for(i=0;i<list.length;i++){document.write(list[i].getAttributeNode("filename").nodeValue + "<br>"); }
</script>
用javascript脚本在dreamweaver中!
<script language="javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false"; //禁止异步操作
xmlDoc.load("xmlFileName"); //载入你的xml文档
list = xmlDoc.getElementsByTagName("file");
for(i=0;i<list.length;i++){document.write(list[i].getAttributeNode("filename").nodeValue + "<br>"); }
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询