internal override void InvokeInternal(ProcessingContext context, int argCount) { StackFrame topArg = context.TopArg; SeekableXPathNavigator contextNode = context.Processor.ContextNode; long currentPosition = contextNode.CurrentPosition; while (topArg.basePtr <= topArg.endPtr) { string str = context.PeekString(topArg.basePtr); NodeSequence val = context.CreateSequence(); if (XPathMessageFunction.MoveToHeader(contextNode) && contextNode.MoveToFirstChild()) { do { long num2 = contextNode.CurrentPosition; string str2 = XPathMessageFunctionActor.ExtractFromNavigator(contextNode); contextNode.CurrentPosition = num2; if (str2 == str) { val.Add(contextNode); } }while (contextNode.MoveToNext()); } context.SetValue(context, topArg.basePtr, val); topArg.basePtr++; } contextNode.CurrentPosition = currentPosition; }
internal override void InvokeInternal(ProcessingContext context, int argCount) { int iterationCount = context.IterationCount; context.PushSequenceFrame(); if (iterationCount > 0) { NodeSequence seq = context.CreateSequence(); seq.StartNodeset(); SeekableXPathNavigator contextNode = context.Processor.ContextNode; long currentPosition = contextNode.CurrentPosition; if (XPathMessageFunction.MoveToAddressingHeader(contextNode, "ReplyTo")) { seq.Add(contextNode); } seq.StopNodeset(); context.PushSequence(seq); for (int i = 1; i < iterationCount; i++) { seq.refCount++; context.PushSequence(seq); } contextNode.CurrentPosition = currentPosition; } }
private static string ExtractFromNavigator(XPathNavigator nav) { if (!XPathMessageFunction.MoveToAddressingHeader(nav, "To")) { return(string.Empty); } return(nav.Value); }
public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext) { string str = XPathMessageFunction.ToString(args[0]); string xpath = string.Format(CultureInfo.InvariantCulture, "/s11:Envelope/s11:Header/*[@s11:actor='{0}'] | /s12:Envelope/s12:Header/*[@s12:role='{1}']", new object[] { str, str }); XPathExpression expr = docContext.Compile(xpath); expr.SetContext((XmlNamespaceManager)xsltContext); return(docContext.Evaluate(expr)); }
internal override void InvokeInternal(ProcessingContext context, int argCount) { context.PushFrame(); int iterationCount = context.IterationCount; if (iterationCount > 0) { context.Push(XPathMessageFunction.ConvertDate(DateTime.Now), iterationCount); } }
internal static double Convert(string dateStr) { try { return(XPathMessageFunction.ConvertDate(DateTime.Parse(dateStr, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.RoundtripKind))); } catch (FormatException) { return(double.NaN); } }
private bool IsSpecialInternalFunction(XPathExpr expr) { if (expr.Type != XPathExprType.XsltFunction) { return(false); } XPathMessageFunction function = ((XPathXsltFunctionExpr)expr).Function as XPathMessageFunction; if (function == null) { return(false); } return((function.ReturnType == XPathResultType.NodeSet) && (function.Maxargs == 0)); }
internal XPathMessageFunctionCallOpcode(XPathMessageFunction fun, int argCount) : base(OpcodeID.XsltInternalFunction) { this.function = fun; this.argCount = argCount; }
public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext) { return(Convert(XPathMessageFunction.ToString(args[0]))); }
public override object Invoke(XsltContext xsltContext, object[] args, XPathNavigator docContext) { return(XPathMessageFunction.ConvertDate(DateTime.UtcNow)); }