#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(); } }
// // 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(); } }
/// <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(); } }
/// <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(); } }
/// <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(); } }
public XPathDocument(Stream stream) { XmlTextReaderImpl reader = this.SetupReader(new XmlTextReaderImpl(string.Empty, stream)); try { this.LoadFromReader(reader, XmlSpace.Default); } finally { reader.Close(); } }
/// <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(); } }
internal void Close(bool closeStream) { _coreReaderImpl.Close(closeStream); _parsingFunction = ParsingFunction.ReaderClosed; }
public override void Close() { _impl.Close(); }