c# - XPathResultType 定义错误?

标签 c# .net xml xslt xpath

.NET 框架中 XPathResultType 枚举的定义为“String”提供了与“Navigator”相同的值 (1)。这肯定是不对的吧?给出了什么?

我正在实现一些自定义 XPath 函数,并且我正在尝试编写一个方法来根据每个参数声明的 XPathResultType 来验证函数的参数。然而,我对如何应对这种重叠感到困惑......


#region Assembly System.Xml.dll, v4.0.30319
// C:\Program Files\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client\System.Xml.dll
#endregion

using System;

namespace System.Xml.XPath
{
    // Summary:
    //     Specifies the return type of the XPath expression.
    public enum XPathResultType
    {
        // Summary:
        //     A numeric value.
        Number = 0,
        //
        // Summary:
        //     A System.String value.
        String = 1,
        //
        // Summary:
        //     A tree fragment.
        Navigator = 1,
        //
        // Summary:
        //     A System.Booleantrue or false value.
        Boolean = 2,
        //
        // Summary:
        //     A node collection.
        NodeSet = 3,
        //
        // Summary:
        //     Any of the XPath node types.
        Any = 5,
        //
        // Summary:
        //     The expression does not evaluate to the correct XPath type.
        Error = 6,
    }
}

最佳答案

Microsoft Connect 上有一个已解决的问题:https://connect.microsoft.com/VisualStudio/feedback/details/97578/both-xpathresulttype-string-and-xpathresulttype-navigator-are-1

微软的答复:

The overlapping enum values is a known issue. The workaround is to never use the XPathResultType.Navigator value and to always use XPathResultType.NodeSet.

关于c# - XPathResultType 定义错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9132649/

相关文章:

java - 当Java Web服务部署在运行同一应用服务器的不同操作系统上时,同一消息的不同数字签名

c# - 查找组名类似的 Active Directory 组

.net - .NET 中带验证的 OAuth

java - 无法实例化 Activity ComponentInfo{ProductSimpleInfoActivity} NullPointerException

c# - 将 DVB-T 流捕获到电影文件

c# - .NET framework 如何为 OutOfMemoryException 分配内存?

c# - AuthenticationManager.SignIn() 不存在于 AuthenticationManager 类中

c# - Unity C# 脚本字典初始化程序不是 C# 4.0 语言规范的一部分

.NET ReaderWriterLockSlim 问题

java - 在 Jasper 报告中如何使用 XML 数据源的子报告创建报告 pdf