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);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Constructor for the <c>InputPosition</c> object. This is
 /// used to create a position description if the provided event
 /// is not null. This will return -1 if the specified event does
 /// not provide any location information.
 /// </summary>
 /// <param name="source">
 /// this is the XML event to get the position of
 /// </param>
 public InputPosition(EventNode source)
 {
     this.source = source;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Constructor for the <c>InputNodeMap</c> object. This is
 /// used to create an input node map, which will be populated
 /// with the attributes from the <c>StartElement</c> that
 /// is specified.
 /// </summary>
 /// <param name="source">
 /// This is the node this node map belongs to.
 /// </param>
 /// <param name="element">
 /// The element to populate the node map with.
 /// </param>
 public InputNodeMap(InputNode source, EventNode element)
 {
     this.source = source;
     this.Build(element);
 }