Пример #1
0
        //
        // This is where the driver receives XmlParser callbacks and translates
        // them into Sax callbacks.  Some more callbacks have been added for
        // Sax2 support.
        //

        internal void startDocument()
        {
            contentHandler.SetDocumentLocator(this);
            contentHandler.StartDocument();
            if (namespaces)
            {
                namespaceSupport.Reset();
                namespaceSupport.PushContext();
            }
            attributeCount = 0;
            attributes     = false;
            for (int i = attributeCount; i < attributeData.Length; i++)
            {
                attributeData[i] = new AttributeData();
            }
        }
Пример #2
0
 /// <summary>
 ///     Reset the writer.
 ///     <para>
 ///         This method is especially useful if the writer throws an
 ///         exception before it is finished, and you want to reuse the
 ///         writer for a new document.  It is usually a good idea to
 ///         invoke <see cref="Flush" /> before resetting the writer,
 ///         to make sure that no output is lost.
 ///     </para>
 ///     <para>
 ///         This method is invoked automatically by the
 ///         <see cref="StartDocument" /> method before writing
 ///         a new document.
 ///     </para>
 ///     <para>
 ///         <strong>Note:</strong> this method will <em>not</em>
 ///         clear the prefix or URI information in the writer or
 ///         the selected output writer.
 ///     </para>
 /// </summary>
 /// <seealso cref="Flush" />
 public void Reset()
 {
     _elementLevel = 0;
     _prefixCounter = 0;
     _nsSupport.Reset();
 }