System.Xml.XmlDocument.Load Method

Loads the XML document from the specified URL.

Syntax

public virtual void Load (string filename)

Parameters

filename
URL for the file containing the XML document to load. The URL can be either a local file or an HTTP URL (a Web address).

Remarks

Note:

The Load method always preserves significant white space. The XmlDocument.PreserveWhitespace property determines whether or not insignificant white space, that is white space in element content, is preserved. The default is false; white space in element content is not preserved.

If you want validation to occur, you can create a validating System.Xml.XmlReader instance by using the System.Xml.XmlReaderSettings class and the erload:System.Xml.XmlReader.Create method. For more information, see Validating XML Data with XmlReader.

This method is a Microsoft extension to the Document Object Model (DOM).

Requirements

Namespace: System.Xml
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0