System.Xml.Xsl.XsltOld.Processor.ValueOf C# (CSharp) Method

ValueOf() private method

private ValueOf ( ActionFrame context, int key ) : String
context ActionFrame
key int
return String
        internal String ValueOf(ActionFrame context, int key) {
            string result;

            Query query = this.GetValueQuery(key, GetValueOfContext());
            object value = query.Evaluate(context.NodeSet);
            if (value is XPathNodeIterator) {
                XPathNavigator n = query.Advance();
                result = n != null ? ValueOf(n) : string.Empty;
            } else {
                result = XmlConvert.ToXPathString(value);
            }

            RecycleValueOfContext();
            return result;
        }

Same methods

Processor::ValueOf ( XPathNavigator n ) : String

Usage Example

示例#1
0
        internal override void Execute(Processor processor, ActionFrame frame)
        {
            Debug.Assert(processor != null && frame != null);

            switch (frame.State)
            {
                case Initialized:
                    Debug.Assert(frame != null);
                    Debug.Assert(frame.NodeSet != null);

                    string value = processor.ValueOf(frame, _selectKey);

                    if (processor.TextEvent(value, _disableOutputEscaping))
                    {
                        frame.Finished();
                    }
                    else
                    {
                        frame.StoredOutput = value;
                        frame.State = ResultStored;
                    }
                    break;

                case ResultStored:
                    Debug.Assert(frame.StoredOutput != null);
                    processor.TextEvent(frame.StoredOutput);
                    frame.Finished();
                    break;

                default:
                    Debug.Fail("Invalid ValueOfAction execution state");
                    break;
            }
        }
All Usage Examples Of System.Xml.Xsl.XsltOld.Processor::ValueOf