本文整理汇总了C#中System.Xml.Xsl.XsltOld.Processor.GetValueQuery方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.GetValueQuery方法的具体用法?C# Processor.GetValueQuery怎么用?C# Processor.GetValueQuery使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.Xsl.XsltOld.Processor
的用法示例。
在下文中一共展示了Processor.GetValueQuery方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
internal override void Execute(Processor processor, ActionFrame frame)
{
Debug.Assert(processor != null && frame != null);
switch (frame.State)
{
case Initialized:
Debug.Assert(frame.NodeSet != null);
Query query = processor.GetValueQuery(_selectKey);
object result = query.Evaluate(frame.NodeSet);
if (result is XPathNodeIterator)
{
// we cash this query because otherwise current() works incorrectly. Bug#382166.
// To be perfect we should use frame.NewNodeSet here
processor.PushActionFrame(CopyNodeSetAction.GetAction(), new XPathArrayIterator(query));
frame.State = NodeSetCopied;
break;
}
XPathNavigator nav = result as XPathNavigator;
if (nav != null)
{
processor.PushActionFrame(CopyNodeSetAction.GetAction(), new XPathSingletonIterator(nav));
frame.State = NodeSetCopied;
break;
}
string value = XmlConvert.ToXPathString(result);
if (processor.TextEvent(value))
{
frame.Finished();
}
else
{
frame.StoredOutput = value;
frame.State = ResultStored;
}
break;
case ResultStored:
Debug.Assert(frame.StoredOutput != null);
processor.TextEvent(frame.StoredOutput);
frame.Finished();
break;
case NodeSetCopied:
Debug.Assert(frame.State == NodeSetCopied);
frame.Finished();
break;
}
}