如何将xmlnode对象分配给经典的ASP变量? [避免使用MSXML2] [英] How to assign xmlnode objects to classic ASP variable ? [avoid MSXML2]

查看:102
本文介绍了如何将xmlnode对象分配给经典的ASP变量? [避免使用MSXML2]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#

XmlDocument doc = new XmlDocument();

doc.LoadXml(xmlData);

XMLNode x = doc.SelectNodes(xpath)



ASP页面

在经典asp中获取x页面

1)如何使用MSXML2引用循环遍历项目?

2)XMLNode对象不能累积到经典asp中的同一排序类型对象。我想念SelectNodes(); selectSingleNode()函数

3)根据no:xml节点构建html



请评论(2) )没有使用MSXML2 / MSXML?参考




我尝试过:



<小> ASP页面

set obj = Server.CreateObject( Msxml2.DOMDocument

1)obj .SelectNodes(Contact) - 返回XMLNode类型的类型

2)obj.selectSingleNode(DateApplied) - 返回类型为
的XMLNodeList软件


用类似的替换所有函数



在经典的asp

推荐答案

您正在比较支持完全不同对象的两种完全不同的技术。 .net比传统的ASP要成熟得多,因此内置的XML处理会更好。 ASP经典只能通过使用MSXML2.DOMDocument的COM对象来做事。 .net在名称空间中使用.net类,这是XmlDocument。如果您不想使用MSXML2.DOMDocument,那么您必须使用一些支持遍历XML的其他COM对象,或编写自己的模仿XmlDocument的对象。如果您使用像ASP这样的旧技术,那么您也需要使用旧的框架对象。
You're comparing two completely different technologies that support completely different objects. .net is far more mature than classic ASP so it's natural that its inbuilt XML handling is going to be better. ASP classic can only do things by using COM objects which is what MSXML2.DOMDocument is. .net uses .net classes in namespaces which is what XmlDocument is. If you don't want to use MSXML2.DOMDocument then you'd have to use some other COM object that supports the traversal of XML, or write your own that mimics XmlDocument. If you're using old tech like ASP then you need to use the old framework objects too.


这篇关于如何将xmlnode对象分配给经典的ASP变量? [避免使用MSXML2]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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