用 C# 实现我自己的 XPathNavigator
我正在寻找从 Microsoft 的 XPathNavigator 类派生的类的 C# 示例实现。 有人可以指点我这样一篇文章吗?
您可能(或可能不知道)知道,XmlNavigator 旨在允许人们在大多数数据模型上叠加 XPath 导航。
我已经实现了派生的 XPathNavigator 类,并且它工作得很好。 很好,递归搜索的 XPath 表达式除外,即“//*”。
我非常确定 Clone、MoveToFirstChild 或 MoveTo 覆盖中有一个微妙的错误,我认为查看另一个示例(如果存在)可能会有所帮助。
另外,我确信我已经看过讨论此问题的杂志文章。 事实证明我的搜索一无所获。 也许有人还记得这样一篇文章。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 Aaron Skonnard 撰写的这篇文章:
“XPath 选择和自定义函数,和更多”,
它提供了从 XPathNavigator。
Look at this article by Aaron Skonnard:
"XPath Selections and Custom Functions, and More",
which provides an example of a class derived from XPathNavigator.
您的实现或 MS 的实现中存在错误吗? 如果是 MS 的话,你可以使用 reflector 来看看里面。
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.