本文整理汇总了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;
}
示例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);
}
示例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.");
}
示例4: FnMin
public static object FnMin (XQueryContext ctx, XPathSequence e)
{
return FnMinImpl (e, ctx.DefaultCollation);
}
示例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;
}
示例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;
}
示例7: FnAvgYearMonthDuration
private static TimeSpan FnAvgYearMonthDuration (XPathSequence e)
{
throw new NotImplementedException ();
}
示例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;
}
示例9: FnRemove
public static XPathSequence FnRemove (XPathSequence target, int position)
{
if (position < 1)
return target;
return new RemovalIterator (target, position);
}
示例10: FnInsertBefore
public static XPathSequence FnInsertBefore (XPathSequence target, int position, XPathSequence inserts)
{
if (position < 1)
position = 1;
return new InsertingIterator (target, position, inserts);
}
示例11: FnDistinctValuesImpl
private static XPathSequence FnDistinctValuesImpl (XQueryContext ctx, XPathSequence items, CultureInfo collation)
{
return new DistinctValueIterator (ctx, items, collation);
}
示例12: FnDistinctValues
public static XPathSequence FnDistinctValues (XQueryContext ctx, XPathSequence items, string collation)
{
return FnDistinctValuesImpl (ctx, items, ctx.GetCulture (collation));
}
示例13: FnExists
public static bool FnExists (XPathSequence e)
{
if (e is XPathEmptySequence)
return false;
return e.MoveNext ();
}
示例14: FnDeepEqual
public static object FnDeepEqual (XQueryContext ctx, XPathSequence p1, XPathSequence p2)
{
return FnDeepEqualImpl (p1, p2, ctx.DefaultCollation);
}
示例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);
}