经典Asp:如何读取xml字符串和获取文本,以及如何计算节点数. [英] Classic Asp : How to read xml string and get text and also how to count number of node.

查看:67
本文介绍了经典Asp:如何读取xml字符串和获取文本,以及如何计算节点数.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

紧急:这对我来说是必需的:

我在经典的asp中有这样的代码.

< hub:notifications xmlns:hub ="http://hub.amdocs.com">
< hub:notificationId> 728dc361-8b4f-4acc-ad2d-a63125c5114</hub:notificationId>
< hub:notificationId> 5b7c6989-ee27-422c-bed-2f2c36136c5b</hub:notificationId>
< hub:notificationId> 67d1fffe-ab3f-43e3-b03-24926debe2dc</hub:notificationId>
</hub:notifications>

i = 0
对于每个节点< hub:notificationId>"在XML流中
ReDim保留aryNotificationID(i +1)
aryNotificationIDs(i)=节点的文本值
我=我+1
下一个节点

如果我有这种xml并获取每个节点的文本,请建议我如何读取xml字符串.

预先感谢.

Hello Friends,

Urgent: This is required for me:

I am having code like that in classic asp.

<hub:notifications xmlns:hub="http://hub.amdocs.com">
<hub:notificationId>728dc361-8b4f-4acc-ad2d-a63125c5114</hub:notificationId>
<hub:notificationId>5b7c6989-ee27-422c-bed-2f2c36136c5b</hub:notificationId>
<hub:notificationId>67d1fffe-ab3f-43e3-b03-24926debe2dc</hub:notificationId>
</hub:notifications>

i = 0
For each node "<hub:notificationId>" in XML stream
ReDim Preserve aryNotificationIDs (i + 1)
aryNotificationIDs(i) = text value of node
i = i + 1
Next node

Please suggest me how to read xml string if i am having this kind of xml and get text of each node.

Thanks in advance.

推荐答案

Herez示例代码:

Herez sample code:

XmlDocument doc = new XmlDocument();
string url = @"c:\temp\test1.xml";
doc.Load(url);
XmlNode node = doc.SelectSingleNode("node1[@date = " + date + "]");


这篇关于经典Asp:如何读取xml字符串和获取文本,以及如何计算节点数.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆