访问属性值 [英] Accessing attribute value

查看:56
本文介绍了访问属性值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的XML文档的一部分如下:
-------------------------------------------------- ---
< xml version ="1.0" encoding ="utf-8"?
-<!-评论->
-< installfileset>
< file name ="C1.DLL" version ="12.0.8168.0">
<文件名="C1XX.DLL"版本="12.0.8168.0">
.
.
.
.
-------------------------------------------------- ---
&等等...

我的问题是,
要在Vc ++ 6.0中访问节点名称,我使用了"pNode-> nodeName;".它可以正常工作,并给出所需的结果文件".
但是,现在我如何访问该节点的值?也就是说,我需要以"C1.DLL"的形式获取结果,该结果必须是字符串.然后,我需要将此字符串值添加到CStringArray列表中.我该怎么办?
我还需要获取版本名称.即将"12.0.8168.0"作为字符串,然后将其添加到CStringArray列表中.

谢谢&问候,
Ramya Suvarna

Hi,

A part of my XML document is as follows:
-----------------------------------------------------
<xml version="1.0" encoding="utf-8" ??
- <!-- comments-->
- <installfileset>
<file name="C1.DLL" version="12.0.8168.0">
<file name="C1XX.DLL" version="12.0.8168.0">
.
.
.
.
-----------------------------------------------------
& so on...

My question is,
to access the node name in Vc++6.0, I used "pNode->nodeName;" and it works fine and gives the result "File" which is desired.
But now how do I access the value of this node? That is, I need to get the result as "C1.DLL" which must be a string. And then I need to add this string value to a CStringArray list. How do I do this?
I need to get the version name as well. That is "12.0.8168.0" as a string and then add it into CStringArray list.

Thanks & Regards,
Ramya Suvarna

推荐答案

节点的可能是另一个节点,子节点(您没有发布相应的XML) File "节点的文本类型.
关于访问属性,同样具有节点"文件"的attributes属性.
:)
The value of the node is possibly (you didn''t post the corrensponding XML) another node, child of the ''File'' node, of type text.
As about accessing attributes, you have the attributes property of, again, the node ''File''.
:)


这篇关于访问属性值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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