k***e 发帖数: 7933 | 1 看xml版很萧条,就放在这里了,hoho。
in xml file, how to easily access a particular node?
in other words, is there to uniquely identify a node(in c#)?
I remember there is a position() function in xsl, don't
know if it works this way.
for example, we can easily access an object in an array
by the index. is there any similar thing in xml? (maybe
just use SelectNodes to select nodes and use index? ) | p***n 发帖数: 635 | 2 there are more than 1 way to do it in C# but one of them is
XPathNavigator.Select Method (XPathExpression)
using namespace System::Xml;
using namespace System::Xml::XPath;
if you know the node's exact XPath,
【在 k***e 的大作中提到】 : 看xml版很萧条,就放在这里了,hoho。 : in xml file, how to easily access a particular node? : in other words, is there to uniquely identify a node(in c#)? : I remember there is a position() function in xsl, don't : know if it works this way. : for example, we can easily access an object in an array : by the index. is there any similar thing in xml? (maybe : just use SelectNodes to select nodes and use index? )
| s*i 发帖数: 5025 | 3 check out XmlDocument
【在 k***e 的大作中提到】 : 看xml版很萧条,就放在这里了,hoho。 : in xml file, how to easily access a particular node? : in other words, is there to uniquely identify a node(in c#)? : I remember there is a position() function in xsl, don't : know if it works this way. : for example, we can easily access an object in an array : by the index. is there any similar thing in xml? (maybe : just use SelectNodes to select nodes and use index? )
| a**y 发帖数: 335 | 4 Use an unique ID as an attribute,
use SelectNodes("//NodeName[@ID='blah']");
This way, it will recursively search for all the nodes under current node.
【在 k***e 的大作中提到】 : 看xml版很萧条,就放在这里了,hoho。 : in xml file, how to easily access a particular node? : in other words, is there to uniquely identify a node(in c#)? : I remember there is a position() function in xsl, don't : know if it works this way. : for example, we can easily access an object in an array : by the index. is there any similar thing in xml? (maybe : just use SelectNodes to select nodes and use index? )
|
|