當前位置: 首頁>>代碼示例>>C#>>正文


C# XPath2.XPathSequence類代碼示例

本文整理匯總了C#中Mono.Xml.XPath2.XPathSequence的典型用法代碼示例。如果您正苦於以下問題:C# XPathSequence類的具體用法?C# XPathSequence怎麽用?C# XPathSequence使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


XPathSequence類屬於Mono.Xml.XPath2命名空間,在下文中一共展示了XPathSequence類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetNSResolver

		internal IXmlNamespaceResolver GetNSResolver (XPathSequence iter)
		{
			// FIXME: IXmlNamespaceResolver must be constructed
			// considering 1)static context and 2)in-scope element
			// construction.
			return iter.Context;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:7,代碼來源:XQueryExpression.cs

示例2: EvaluateNode

		public XPathSequence EvaluateNode (XPathSequence iter, XPathNodeType moveAfterCreation)
		{
			XmlDocument doc = new XmlDocument ();
			XmlWriter w = iter.Context.Writer;
			try {
				iter.Context.Writer = doc.CreateNavigator ().AppendChild ();
				Serialize (iter);
				iter.Context.Writer.Close ();
			} finally {
				iter.Context.Writer = w;
			}
			XPathNavigator nav = doc.CreateNavigator ();
			switch (moveAfterCreation) {
			case XPathNodeType.Attribute:
				nav.MoveToFirstAttribute ();
				break;
			case XPathNodeType.Root:
				break;
			default:
				nav.MoveToFirstChild ();
				break;
			}
			return new SingleItemIterator (nav, iter.Context);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:24,代碼來源:XQueryExpression.cs

示例3: FnMinImpl

		private static object FnMinImpl (XPathSequence e, CultureInfo collation)
		{
			if (!e.MoveNext ())
				return null;
			switch (e.Current.XmlType.TypeCode) {
			case XmlTypeCode.DayTimeDuration:
				return FnMinDayTimeDuration (e);
			case XmlTypeCode.YearMonthDuration:
				return FnMinYearMonthDuration (e);
			case XmlTypeCode.Decimal:
				return FnMinDecimal (e);
			case XmlTypeCode.Integer:
				return FnMinInteger (e);
			case XmlTypeCode.Float:
				return FnMinFloat (e);
			case XmlTypeCode.UntypedAtomic:
			case XmlTypeCode.Double:
				return FnMinDouble (e);
			}
			throw new XmlQueryException ("avg() function detected that the sequence contains an item whose type is neither of dayTimeDuration, yearMonthDuration, decimal, integer, float, double, nor untypedAtomic.");
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:21,代碼來源:XQueryFunctionCliImpl.cs

示例4: FnMin

		public static object FnMin (XQueryContext ctx, XPathSequence e)
		{
			return FnMinImpl (e, ctx.DefaultCollation);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:4,代碼來源:XQueryFunctionCliImpl.cs

示例5: FnMaxFloat

		private static float FnMaxFloat (XPathSequence e)
		{
			float ret = float.MinValue;
			do {
				ret = System.Math.Max (e.Current.ValueAsSingle, ret);
			} while (e.MoveNext ());
			return ret;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:8,代碼來源:XQueryFunctionCliImpl.cs

示例6: FnMaxDecimal

		private static decimal FnMaxDecimal (XPathSequence e)
		{
			decimal ret = decimal.MinValue;
			do {
				ret = System.Math.Max (e.Current.ValueAsDecimal, ret);
			} while (e.MoveNext ());
			return ret;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:8,代碼來源:XQueryFunctionCliImpl.cs

示例7: FnAvgYearMonthDuration

		private static TimeSpan FnAvgYearMonthDuration (XPathSequence e)
		{
			throw new NotImplementedException ();
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:4,代碼來源:XQueryFunctionCliImpl.cs

示例8: FnDeepEqualImpl

		public static bool FnDeepEqualImpl (XPathSequence p1, XPathSequence p2, CultureInfo collation)
		{
			// FIXME: use collation
			while (p1.MoveNext ()) {
				if (!p2.MoveNext ())
					return false;
				if (!FnDeepEqualItem (p1.Current, p2.Current, collation))
					return false;
			}
			if (p2.MoveNext ())
				return false;
			return true;
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:13,代碼來源:XQueryFunctionCliImpl.cs

示例9: FnRemove

		public static XPathSequence FnRemove (XPathSequence target, int position)
		{
			if (position < 1)
				return target;
			return new RemovalIterator (target, position);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:6,代碼來源:XQueryFunctionCliImpl.cs

示例10: FnInsertBefore

		public static XPathSequence FnInsertBefore (XPathSequence target, int position, XPathSequence inserts)
		{
			if (position < 1)
				position = 1;
			return new InsertingIterator (target, position, inserts);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:6,代碼來源:XQueryFunctionCliImpl.cs

示例11: FnDistinctValuesImpl

		private static XPathSequence FnDistinctValuesImpl (XQueryContext ctx, XPathSequence items, CultureInfo collation)
		{
			return new DistinctValueIterator (ctx, items, collation);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:4,代碼來源:XQueryFunctionCliImpl.cs

示例12: FnDistinctValues

		public static XPathSequence FnDistinctValues (XQueryContext ctx, XPathSequence items, string collation)
		{
			return FnDistinctValuesImpl (ctx, items, ctx.GetCulture (collation));
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:4,代碼來源:XQueryFunctionCliImpl.cs

示例13: FnExists

		public static bool FnExists (XPathSequence e)
		{
			if (e is XPathEmptySequence)
				return false;
			return e.MoveNext ();
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:6,代碼來源:XQueryFunctionCliImpl.cs

示例14: FnDeepEqual

		public static object FnDeepEqual (XQueryContext ctx, XPathSequence p1, XPathSequence p2)
		{
			return FnDeepEqualImpl (p1, p2, ctx.DefaultCollation);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:4,代碼來源:XQueryFunctionCliImpl.cs

示例15: FnReverse

		public static XPathSequence FnReverse (XPathSequence arg)
		{
			ArrayList al = new ArrayList ();
			while (arg.MoveNext ())
				al.Add (arg.Current);
			al.Reverse ();
			return new ListIterator (arg.Context, al);
		}
開發者ID:Profit0004,項目名稱:mono,代碼行數:8,代碼來源:XQueryFunctionCliImpl.cs


注:本文中的Mono.Xml.XPath2.XPathSequence類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。