IXMLDOMDocument.load (C#)

The load method loads an XML document with the contents of the file at the specified location.

Boolean = IXMLDOMDocument.load(
  string strxmlSource
);

Arguments

strxmlSource

[in] string containing a URL that specifies the location of the XML file.

Return Value

Returns true if the load succeeded and false if the load failed.

Remarks

To indicate a specific data source plug-in, other than the WMS File Data Source plug-in, the URL prefix for that plug-in must be specified. If no URL is specified, the server defaults to the WMS File Data Source plug-in. For example, to specify a file on a FAT, NTFS, or any CIFS file system, use c:\wmpub\wmroot\movie.xml or file://c:\wmpub\wmroot\movie.xml ("file://" identifies the URL scheme for the WMS File Data Source plug-in). The WMS HTML playlist parser plug-in supports only the .htm file extension.

Calling load or loadXML on an existing document immediately discards the content of the document.

This method is an extension of the World Wide Web Consortium (W3C) Document Object Model (DOM).

Example

The following example creates an IXMLDOMDocumentIXMLDOMDocument Object (C#) and uses the load method to load a local XML file.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMNodeList NodeList;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Create a new playlist object.
    Playlist = Server.CreatePlaylist();

    // Load a playlist.
    Playlist.load(("file://c:\\wmpub\\wmroot\\simple.wsx"));
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add references to Microsoft.WindowsMediaServices and interop_msxml.

Namespace: Microsoft.WindowsMediaServices.Interop, interop_msxml.

Assembly: Microsoft.WindowsMediaServices.dll, interop_msxml.dll.

Library: WMSServerTypeLib.dll, msxml.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Reference

IXMLDOMDocument Object (C#)

Concepts

XML DOM Methods (C#)