Ejemplo n.º 1
0
        /// <summary>
        /// Read the contents of the characters between the specified XML
        /// element tags, if the read is currently at that element. This
        /// allows characters associated with the element to be used. If
        /// the specified node is not the current node, null is returned.
        /// </summary>
        /// <param name="from">
        /// This is the input node to read the value from.
        /// </param>
        /// <returns>
        /// This returns the characters from the specified node.
        /// </returns>
        public String ReadValue(InputNode from)
        {
            StringBuilder value = new StringBuilder();

            while (stack.Top() == from)
            {
                EventNode node = reader.Peek();

                if (!node.IsText())
                {
                    if (value.Length == 0)
                    {
                        return(null);
                    }
                    return(value.ToString());
                }
                String data = node.Value;
                value.Append(data);
                reader.Next();
            }
            return(null);
        }