XmlNodeList - 如何找出原始子集合中的节点索引? [英] XmlNodeList - how to find out index of node in original child collection?

查看:172
本文介绍了XmlNodeList - 如何找出原始子集合中的节点索引?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




给定一个节点,如何在
所属的节点集合中找到它的索引?


谢谢

Hi,

Given a node, how can one find out its index in the collection of nodes it
belongs to?

Thanks

推荐答案

无法获取此信息。同样地,没有办法在一个数组中询问

一个整数,它位于数组的位置。


-

此帖子按原样提供。没有保证,也没有赋予任何权利。


" Marina" <所以***** @ nospam.com>在消息中写道

新闻:OV ************** @ tk2msftngp13.phx.gbl ...
There is no way to get this information. The same way there is no way to ask
an integer in an array which position in the array it came from.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Marina" <so*****@nospam.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...

给定一个节点,如何在它所属的节点集合中找到它的索引?

谢谢
Hi,

Given a node, how can one find out its index in the collection of nodes it
belongs to?

Thanks



无法获取此信息。同样地,没有办法在一个数组中询问

一个整数,它位于数组的位置。


-

此帖子按原样提供。没有保证,也没有赋予任何权利。


" Marina" <所以***** @ nospam.com>在消息中写道

新闻:OV ************** @ tk2msftngp13.phx.gbl ...
There is no way to get this information. The same way there is no way to ask
an integer in an array which position in the array it came from.

--
This posting is provided "AS IS" with no warranties, and confers no rights.

"Marina" <so*****@nospam.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...

给定一个节点,如何在它所属的节点集合中找到它的索引?

谢谢
Hi,

Given a node, how can one find out its index in the collection of nodes it
belongs to?

Thanks



这不是真的。


我找到了一种方法通过XPATH做到这一点,这样的工作:

node.SelectNodes(" preceding-sibling :: *")。计数


" Dare Obasanjo [MSFT]" <哒*** @ online.microsoft.com>在消息中写道

news:40 ****** @ news.microsoft.com ...
That is not true.

I found a way to do it via XPATH, something like this works:

node.SelectNodes("preceding-sibling::*").Count

"Dare Obasanjo [MSFT]" <da***@online.microsoft.com> wrote in message
news:40******@news.microsoft.com...
无法获取此信息。同样的方法是没有办法
在一个数组中询问一个整数,该数组位于它来自的数组中。

-
这个帖子是按照原样提供的。没有保证,并且不授予
权利。
Marina <所以***** @ nospam.com>在消息中写道
新闻:OV ************** @ tk2msftngp13.phx.gbl ...
There is no way to get this information. The same way there is no way to ask an integer in an array which position in the array it came from.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Marina" <so*****@nospam.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl...

给定一个节点,如何在它所属的节点
集合中找到它的索引?

Hi,

Given a node, how can one find out its index in the collection of nodes it belongs to?

Thanks




这篇关于XmlNodeList - 如何找出原始子集合中的节点索引?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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