Share via


IXMLDOMDocument.save (C#)

banner art

Previous Next

IXMLDOMDocument.save (C#)

The save method saves an XML document to the specified location.

Syntax

  IXMLDOMDocument
  .save(
  object objDestination
);

Parameters

objDestination

[in] object representing a file name.

Remarks

The URL scheme and the file name extension identify the data source plug-in and the playlist parser plug-in respectively. Use the URL prefix property, accessible from the IWMSNamedValues collection, to indicate the URL scheme used by the data source plug-in. Use the URL suffix property, accessible from the IWMSNamedValues collection, to specify the file name extension supported by the playlist parser. If no URL is specified, the server defaults to the WMS File Data Source plug-in. 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.

A saved XML document might not load if the URLs are not accessible from the location in which you saved the document.

UTF-8 character encoding is used when saving a playlist document.

Validation is not performed by the save method.

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

Example Code

The following example saves a newly created XML document to a specified location.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;

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

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

    // Save the current XML document to the specified location.
    Playlist.save("c:\\test.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

Previous Next