在编程时使用到这个枚举,调试老出错,后发现两个值是一样的,两个都是等于1,我使用的是.NET2.0
Xml.XPath.XPathResultType.String = 1
Xml.XPath.XPathResultType.Navigator = 1
Xml.XPath.XPathResultType.String = 1
Xml.XPath.XPathResultType.Navigator = 1
解决方案 »
- c# 添加到数据库的字符串是一个路径,路径中带有\n,结果被认为是转义字符,怎么处理,高手指教!!!
- 散分,又发现.net的一个bug,浪费了我2天时间
- 如何解除 受到“Windows 系统文件保护”的限制
- 做了一个软件给客户,如何实现sn功能
- access查询的问题:
- 快捷键的设置
- 求关于asp.net或SQL或C#的英文译文,提供者都给分,谢谢
- 求助:问个题 题目短短短!!!!!!!!!!!!!!!!!!!
- 想用C#+ADO.NET+ACCESS做个查询程序,怎么才能显示ACCESS中存储的图片??求教!分数大大的有!!大家帮帮俺!!
- 连数据库的问题。很急在线等。
- 写SQL语句的问题,怎么判断字段里的日期是否为今天?
- 怎么判断一个类型是否继承另一个类型?
例如public enum color
{
blace=0,red,yellow=1
}
red和yellow都为1
Xml.XPath.XPathResultType.String = 1
Xml.XPath.XPathResultType.Navigator = 4才对
Xml.XPath.XPathResultType.Navigator = 4 ---1,4是什么意思?
Any 任何一种 XPath 节点类型。
Boolean Booleantrue 或 false 值。
Error 该表达式的计算结果不是正确的 XPath 类型。
Navigator 一个树片段。
NodeSet 一个节点集合。
Number 一个数值。
String String 值。 楼主好厉害哦,这都能碰到
5 2 6 1 3 0 1
由 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