Ejemplo n.º 1
0
#pragma warning restore 618

        internal static void ParseXmlDeclarationValue(string strValue, out string version, out string encoding, out string standalone)
        {
            version    = null;
            encoding   = null;
            standalone = null;
            XmlTextReaderImpl tempreader = new XmlTextReaderImpl(strValue, (XmlParserContext)null);

            try
            {
                tempreader.Read();
                //get version info.
                if (tempreader.MoveToAttribute("version"))
                {
                    version = tempreader.Value;
                }
                //get encoding info
                if (tempreader.MoveToAttribute("encoding"))
                {
                    encoding = tempreader.Value;
                }
                //get standalone info
                if (tempreader.MoveToAttribute("standalone"))
                {
                    standalone = tempreader.Value;
                }
            }
            finally
            {
                tempreader.Close();
            }
        }
Ejemplo n.º 2
0
        //
        // Input documents management
        //

        internal static XPathDocument LoadDocument(XmlTextReaderImpl reader)
        {
            reader.EntityHandling = EntityHandling.ExpandEntities;
            reader.XmlValidatingReaderCompatibilityMode = true;
            try {
                return(new XPathDocument(reader, XmlSpace.Preserve));
            }
            finally {
                reader.Close();
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a new document and load the content from the text reader.
        /// </summary>
        public XPathDocument(TextReader textReader)
        {
            XmlTextReaderImpl reader = SetupReader(new XmlTextReaderImpl(string.Empty, textReader));

            try {
                LoadFromReader(reader, XmlSpace.Default);
            }
            finally {
                reader.Close();
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Create a new document and load the content from the Uri, with whitespace handling controlled according to "space".
        /// </summary>
        public XPathDocument(string uri, XmlSpace space)
        {
            XmlTextReaderImpl reader = SetupReader(new XmlTextReaderImpl(uri));

            try {
                LoadFromReader(reader, space);
            }
            finally {
                reader.Close();
            }
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Create a new document and load the content from the Uri, with whitespace handling controlled according to "space".
        /// </summary>
        public XPathDocument([StringSyntax(StringSyntaxAttribute.Uri)] string uri, XmlSpace space)
        {
            XmlTextReaderImpl reader = SetupReader(new XmlTextReaderImpl(uri));

            try
            {
                LoadFromReader(reader, space);
            }
            finally
            {
                reader.Close();
            }
        }
Ejemplo n.º 6
0
        public XPathDocument(Stream stream)
        {
            XmlTextReaderImpl reader = this.SetupReader(new XmlTextReaderImpl(string.Empty, stream));

            try
            {
                this.LoadFromReader(reader, XmlSpace.Default);
            }
            finally
            {
                reader.Close();
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Create a new document and load the content from the stream.
        /// </summary>
        public XPathDocument(Stream stream)
        {
            ArgumentNullException.ThrowIfNull(stream);

            XmlTextReaderImpl reader = SetupReader(new XmlTextReaderImpl(string.Empty, stream));

            try
            {
                LoadFromReader(reader, XmlSpace.Default);
            }
            finally
            {
                reader.Close();
            }
        }
Ejemplo n.º 8
0
 internal void Close(bool closeStream)
 {
     _coreReaderImpl.Close(closeStream);
     _parsingFunction = ParsingFunction.ReaderClosed;
 }
Ejemplo n.º 9
0
 public override void Close()
 {
     _impl.Close();
 }