Groups | Blog | Home
all groups > dotnet xml > october 2005 >

dotnet xml : Difference between noditerator.movenext and...



darrel
10/31/2005 3:25:00 PM
If I create a node iterator using an xpath expression pointing to a specific
node, this will give me the value of that node:

ni.movenext()
ni.current.tostring

However, this doesn't:

ni.movenext.tostring

why is that? I'm not exactly sure what that second line is actually doing.
It appears to be returning the value of a sibling node several items down.

-Darrel

darrel
11/1/2005 9:32:44 AM
[quoted text, click to view]

Huh. VS.net is letting it compile for me. Odd.

[quoted text, click to view]

Ah! It returns a boolean. That explains what it's doing! Thanks.

[quoted text, click to view]

That will be nice.

-Darrel

Oleg Tkachenko [MVP]
11/1/2005 11:04:26 AM
[quoted text, click to view]

This won't compile anyway. If you mean ni.MoveNext().ToString() then
it's meaningless. MoveNext() method moves iterator to a next node and
returns boolean meaning true - success, false - no more nodes.
In .NET 2.0 you can use XPathNavigator().SelectSingleNode() method to
get XPathNavigator directly.

--
Oleg Tkachenko [XML MVP, MCAD]
AddThis Social Bookmark Button