以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XML基础 』  (http://bbs.xml.org.cn/list.asp?boardid=1)
----  这个XML文件的结构不同一般的  (http://bbs.xml.org.cn/dispbbs.asp?boardid=1&rootid=&id=53330)


--  作者:rdboy
--  发布时间:10/2/2007 12:30:00 AM

--  这个XML文件的结构不同一般的
<?xml version='1.0' encoding='utf-8'?>

<Profiles>
<pro>
<str txt='浦北检察院外部信息网正在调试之中' txturl="http://127.0.0.1/typenews.asp?id=92" date="2007年9月29日"></str>

<str txt='北京奥组委成立' txturl="http://sports.sina.com.cn/o/2003-08-03/1613526814.shtml" date="2001年12月13日"></str>

<str txt="北京奥运会会徽发布" txturl="http://sports.sina.com.cn/o/2003-08-03/2100526953.shtml" date="2003年8月3日"></str>

<str txt="国家体育场开工奠基" txturl="http://sports.sina.com.cn/o/2003-12-24/1255710884.shtml" date="2003年12月24日"></str>


<str txt="北京残奥会会徽发布" txturl="http://2004.sina.com.cn/photo_zt/212/index.shtml" date="2004年7月13日"></str>


<str txt="北京接过奥运旗帜" txturl="http://2004.sina.com.cn/photo_zt/1964/index.shtml" date="2004年8月29日"></str>


<str txt="奥运主题口号发布" txturl="http://sports.sina.com.cn/z/beijing2003_2008/photo/16434/" date="2005年6月26日"></str>

<str txt="奥运吉祥物发布" txturl="http://sports.sina.com.cn/z/2008mfigure/" date="2005年11月11日"></str>

<str txt="奥运体育图标发布" txturl="http://sports.sina.com.cn/z/08countdown2y/photo/31075/" date="2006年8月7日"></str>

<str txt="北京奥运倒计时两周年" txturl="http://sports.sina.com.cn/z/08countdown2y/" date="2006年8月8日"></str>

<str txt="北京奥运志愿者招募" txturl="http://sports.sina.com.cn/z/08volunteer/" date="2006年8月28日"></str>

<str txt="北京残奥会吉祥物揭晓" txturl="http://sports.sina.com.cn/z/08pmascot/" date="2005年9月5日"></str>

<str txt="鸟巢钢结构卸载" txturl="http://sports.sina.com.cn/z/niaochao/" date="2006年9月15日"></str>

<str txt="水立方全景亮相" txturl="http://sports.sina.com.cn/z/08watercube/" date="2006年12月26日"></str>

<str txt="奥运奖牌样式公布" txturl="http://2008.sina.com.cn/z/2008medal/" date="2007年03月27日"></str>


<str txt="奥运门票全球发售" txturl="http://2008.sina.com.cn/z/2008ticket/" date="2007年04月15日"></str>


<str txt="火炬样式及路线公布" txturl="http://2008.sina.com.cn/z/2008torch/" date="2007年04月26日"></str>


<str txt="奥运火炬手选拔启动" txturl="http://2008.sina.com.cn/z/2008torch_runner/" date="2007年06月23日"></str>

<str txt="奥运主题口号发布" txturl="http://sports.sina.com.cn/z/beijing2003_2008/photo/16434/" date="2005年6月26日"></str>

<str txt="奥运吉祥物发布" txturl="http://sports.sina.com.cn/z/2008mfigure/" date="2005年11月11日"></str>

<str txt="奥运体育图标发布" txturl="http://sports.sina.com.cn/z/08countdown2y/photo/31075/" date="2006年8月7日"></str>

<str txt="北京奥运倒计时两周年" txturl="http://sports.sina.com.cn/z/08countdown2y/" date="2006年8月8日"></str>

<str txt="北京奥运志愿者招募" txturl="http://sports.sina.com.cn/z/08volunteer/" date="2006年8月28日"></str>

</pro>
</Profiles>

这是新浪网站flash演示的文件,节点结构和一般的XML有所不同,应当如何用ASP读写啊,请指点,谢谢


--  作者:Qr
--  发布时间:10/9/2007 9:16:00 AM

--  
没看出什么特殊的。

xmlDoc.load("yourxml.xml")

objNodeList = xmlDoc.getElementsByTagName("str")

objNodeList.length可以统计str个数

attributes可以返回当前节点的属性


偶这里没有ASP的环境,就不写代码了,建议参考MSXML DOM手册,上面有js代码,改成VBS就可以了。


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
63.477ms