Пример #1
0
        private void Init(Stream input, FIVocabularyManager vocabularyManager, XmlNameTable nameTable)
        {
            if (input == null)
            {
                throw new ArgumentNullException("Stream is null.");
            }

            _state                 = ReadState.Initial;
            _nodeType              = XmlNodeType.None;
            _currentNode           = null;
            _currentAttributeIndex = -1;
            _currentAttributeValue = null;
            _attributeValueIndex   = -1;

            _parser = new FIParser(input, vocabularyManager, nameTable);
        }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the XmlTextReader class with the specified file.
        /// </summary>
        /// <param name="url">The URL for the file containing the XML data.</param>
        /// <param name="vocabularyManager">A <see cref="FIVocabularyManager"/> containing a mapping of URIs to <see cref="FIExternalVocabulary"/> objects. If the Fast Infoset to be read references an External Vocabulary, the URI used must exist with the provided vocabulary manager.</param>
        /// <param name="nameTable">An <see cref="XmlNameTable"/> to write strings into.</param>
        /// <exception cref="ArgumentNullException">url is a null reference (Nothing in Visual Basic)</exception>
        /// <exception cref="ArgumentException">url is an empty string.</exception>
        /// <exception cref="UriFormatException">url is not a valid URI.</exception>
        /// <exception cref="Exception">There is a runtime error (for example, an interrupted server connection).</exception>
        /// <seealso cref="FIVocabularyManager"/>
        /// <seealso cref="FIExternalVocabulary"/>
        public FIReader(string url, FIVocabularyManager vocabularyManager, XmlNameTable nameTable)
        {
            if (url == null)
            {
                throw new ArgumentNullException("url is null.");
            }

            if (url.Length == 0)
            {
                throw new ArgumentException("url is an empty string.");
            }

            Stream input = (Stream)((new XmlUrlResolver()).GetEntity(new Uri(url), null, typeof(Stream)));

            Init(input, vocabularyManager, nameTable);
        }
Пример #3
0
 /// <summary>
 /// Initializes a new instance of the XmlTextReader class with the specified file.
 /// </summary>
 /// <param name="url">The URL for the file containing the XML data.</param>
 /// <param name="vocabularyManager">A <see cref="FIVocabularyManager"/> containing a mapping of URIs to <see cref="FIExternalVocabulary"/> objects. If the Fast Infoset to be read references an External Vocabulary, the URI used must exist with the provided vocabulary manager.</param>
 /// <exception cref="ArgumentNullException">url is a null reference (Nothing in Visual Basic)</exception>
 /// <exception cref="ArgumentException">url is an empty string.</exception>
 /// <exception cref="UriFormatException">url is not a valid URI.</exception>
 /// <exception cref="Exception">There is a runtime error (for example, an interrupted server connection).</exception>
 /// <seealso cref="FIVocabularyManager"/>
 /// <seealso cref="FIExternalVocabulary"/>
 public FIReader(string url, FIVocabularyManager vocabularyManager) : this(url, vocabularyManager, null)
 {
 }
Пример #4
0
 /// <summary>
 /// Initializes a new instance of the XmlTextReader class with the specified stream.
 /// </summary>
 /// <param name="input">The stream containing the XML data to read.</param>
 /// <param name="vocabularyManager">A <see cref="FIVocabularyManager"/> containing a mapping of URIs to <see cref="FIExternalVocabulary"/> objects. If the Fast Infoset to be read references an External Vocabulary, the URI used must exist with the provided vocabulary manager.</param>
 /// <param name="nameTable">An <see cref="XmlNameTable"/> to write strings into.</param>
 /// <exception cref="ArgumentNullException">input is a null reference (Nothing in Visual Basic).</exception>
 /// <seealso cref="FIVocabularyManager"/>
 /// <seealso cref="FIExternalVocabulary"/>
 public FIReader(Stream input, FIVocabularyManager vocabularyManager, XmlNameTable nameTable)
 {
     Init(input, vocabularyManager, nameTable);
 }
Пример #5
0
 /// <summary>
 /// Initializes a new instance of the XmlTextReader class with the specified stream.
 /// </summary>
 /// <param name="input">The stream containing the XML data to read.</param>
 /// <param name="vocabularyManager">A <see cref="FIVocabularyManager"/> containing a mapping of URIs to <see cref="FIExternalVocabulary"/> objects. If the Fast Infoset to be read references an External Vocabulary, the URI used must exist with the provided vocabulary manager.</param>
 /// <exception cref="ArgumentNullException">input is a null reference (Nothing in Visual Basic).</exception>
 /// <seealso cref="FIVocabularyManager"/>
 /// <seealso cref="FIExternalVocabulary"/>
 public FIReader(Stream input, FIVocabularyManager vocabularyManager) : this(input, vocabularyManager, null)
 {
 }