System.Xml.XmlDocument.LoadXml Method

Loads the XML document from the specified string.

Syntax

public virtual void LoadXml (string xml)

Parameters

xml
String containing the XML document to load.

Remarks

By default the LoadXml method does not preserve white space or significant white space.

This method parses DTDs, but does not do DTD or Schema validation. 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.

If you want to load from a System.IO.Stream, string, System.IO.TextReader, or System.Xml.XmlReader, use the Load method instead of this method.

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