Beispiel #1
0
        /// <summary>
        /// Checks if the character sequence is equal to ]]&gt;.
        /// </summary>
        /// <param name="ch">The character to examine.</param>
        /// <returns>The token if everything is alright.</returns>
        XmlToken CheckCharacter(Char ch)
        {
            if (ch == Specification.SBC)
            {
                if (_src.Next == Specification.GT)
                {
                    throw Errors.Xml(ErrorCode.XmlInvalidCharData);
                }

                _src.Back();
            }

            _src.Back();
            return(XmlToken.Character(Specification.SBC));
        }
Beispiel #2
0
        /// <summary>
        /// More http://www.w3.org/TR/REC-xml/#sec-logical-struct.
        /// </summary>
        /// <param name="c">The next input character.</param>
        XmlToken Data(Char c)
        {
            switch (c)
            {
            case Specification.AMPERSAND:
                return(CharacterReference(_src.Next));

            case Specification.LT:
                return(TagOpen(_src.Next));

            case Specification.EOF:
                return(XmlToken.EOF);

            case Specification.SBC:
                return(CheckCharacter(_src.Next));

            default:
                return(XmlToken.Character(c));
            }
        }