Implementing my own XPathNavigator in C#

 ̄綄美尐妖づ 提交于 2019-12-21 05:23:28

问题


I am looking for a C# example implementation of a class derived from Microsoft's XPathNavigator class. Can any one point me at such an article?

As you may (or may not) know, the XmlNavigator is designed to allow one to superimpose XPath navigation on most any data model.

I have implemented my derived XPathNavigator class and it works very well. Very well that is except for XPath expressions that search recursively, i.e. "//*".

I am pretty sure that I have a subtle bug in the Clone, MoveToFirstChild, or MoveTo overides and I thought it might help to look at another example if one exists.

Also, I am sure that I have seen magazine articles that discuss this. My searches have proved yielded nothing. Maybe someone remembers such an article.


回答1:


Look at this article by Aaron Skonnard:

"XPath Selections and Custom Functions, and More",

which provides an example of a class derived from XPathNavigator.




回答2:


A bug in your implementation or the MS one? If it's the MS one then you can use reflector to take a peek inside.



来源:https://stackoverflow.com/questions/390178/implementing-my-own-xpathnavigator-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!