在编程时使用到这个枚举,调试老出错,后发现两个值是一样的,两个都是等于1,我使用的是.NET2.0
Xml.XPath.XPathResultType.String = 1
Xml.XPath.XPathResultType.Navigator = 1

解决方案 »

  1.   

    I don't what you want to ask!!he he
      

  2.   

    I don't konw what you want to ask!!he he
      

  3.   

    枚举可以这样,你出错在于你错误的使用了枚举,贴出你的code
      

  4.   

    枚举可以得到一样的值
    例如public enum color
    {
      blace=0,red,yellow=1
    }
    red和yellow都为1
      

  5.   

    这的确是出错了呀,两个值不可能相等的
    Xml.XPath.XPathResultType.String = 1
    Xml.XPath.XPathResultType.Navigator = 4才对
      

  6.   

    呵呵,希望是,我也看着.net不狗顺眼
      

  7.   

    Xml.XPath.XPathResultType.String = 1 
    Xml.XPath.XPathResultType.Navigator = 4 ---1,4是什么意思?
      

  8.   

    成员名称             说明 
     Any              任何一种 XPath 节点类型。  
     Boolean          Booleantrue 或 false 值。  
     Error            该表达式的计算结果不是正确的 XPath 类型。  
     Navigator        一个树片段。  
     NodeSet          一个节点集合。  
     Number           一个数值。  
     String           String 值。  楼主好厉害哦,这都能碰到
      

  9.   

    真的耶,从any 到 string 分别是:
     5 2 6 1 3 0 1
      

  10.   

    描述In XPathResultType, both String and Navigator has internal integer value 1 while 4 is blank.建议Thank you for bringing up this issue. The overlapping enum values is a known issue. The workaround is to never use the XPathResultType.Navigator value and to always use XPathResultType.NodeSet.
    由 Microsoft 在 2005/2/9 12:28 发送
    It is not a workaround. Result tree fragment and node set are different.Is there KB article?
    由 AtsushiEno 在 2005/2/11 18:55 发送
    Also, note that current XslTransform has a bug which seems related to this XPathResultType value. For example,<?xml version="1.0"?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"><!-- FileName: select67 -->
    <!-- Document: http://www.w3.org/TR/xpath -->
    <!-- DocVersion: 19991116 -->
    <!-- Section: 12.1 -->
    <!-- Creator: David Marston -->
    <!-- Purpose: Test that document('') refers to this stylesheet, and exploit
         that fact to choose a template dynamically. Idea from Mike Kay. --><xsl:template match="/document-element">
    <xsl:variable name="whichtmplt" select="'this'"/>
    <out>
        <xsl:apply-templates select="document('')/*/xsl:template[@name=$whichtmplt]"/>
        <xsl:apply-templates/>
    </out>
    </xsl:template><xsl:template name="this" match="xsl:template[@name='this']">We are inside.
    <xsl:value-of select="name(.)"/>
    </xsl:template><xsl:template name="that" match="xsl:template[@name='that']">We are offside.
    <xsl:value-of select="name(.)"/>
    </xsl:template><xsl:template name="the_other" match="*">We are generic.
    <xsl:value-of select="name(.)"/>
    </xsl:template></xsl:stylesheet>XslTransform fails to generate correct result for this OASIS test (select_select67.xsl)
    http://www.oasis-open.org/committees/documents.php?wg_abbrev=xslt由 AtsushiEno 在 2005/2/17 22:22 发送
    I believe this problem is a result of using the document() function with an empty string. The XSLT specification specifies that this maps to the stylesheet being executed. However, the System.Xml implementation does not do this as it leads to memory overhead because the original stylesheet must always be cached. We feel that apart from test cases, this feature is not interesting in real-world scenarios.Thank you for your feedback,
    Arpan Desai
    Program Manager
    由 Microsoft 在 2005/3/21 11:18 发送
    You seems right. I reexamined and it only happens when the input was XmlDocument. So it must not be because of this enum. Sorry for confusion.
    由 AtsushiEno 在 2005/3/22 5:25 发送Product LanguageEnglishVersionCommunity Technology Preview October 2004CategoryXMLSubcategory Operating SystemWindows 2000 ProfessionalSteps to Reproduceusing System;
    using System.Xml.XPath;
    public class Tst
    {
    public static void Main ()
    {
    foreach (XPathResultType e in Enum.GetValues (typeof (XPathResultType)))
    Console.WriteLine ("{0} is {1}", e, (int) e);
    }
    }
    Actual ResultsNumber is 0
    String is 1
    String is 1
    Boolean is 2
    NodeSet is 3
    Any is 5
    Error is 6Expected ResultsNumber is 0
    String is 1
    Boolean is 2
    NodeSet is 3
    Navigator is 4
    Any is 5
    Error is 6