Programmer's Guide > Interfaces > Application interface > openDocument method
  
openDocument method
Reads an XML or SGML file and creates a new Document object that may be used to navigate the document's content. The method may also be used to create an empty document if path is null, similar to the createDocument method of the DOMImplementation interface.
The pubid and sysid arguments specify the document type for the document if path is omitted or null, if the associated file does not specify a DOCTYPE declaration, or if bit OPEN_FORCEDT is included in flags. The pubid and sysid arguments are ignored if path specifies an SGML file that starts with a DOCTYPE declaration, if OPEN_FORCEDT is not specified, or if path specifies a binary document file. If the document type is not specified, is "ascii", or cannot be determined the document is opened in untagged mode.
openDocument( [path [, flags [, name [, pubId [, sysId [, stylesheet]]]]]] )
Parameters
Stringpath
[optional] Specifies the path name of a document directory or the file name from which to load the initial contents of the document tree. May be a "file://" or "http://" URL. If the URL specifies a server supporting WebDAV, the file will be opened for editing (Windows only). If the server does not support WebDAV, the file will be opened as read-only. If null or an empty string, the document is empty.
intflags
[optional] A bitmask that specifies open options. Constructed by ORing the bits from the LoadFlags enumeration.
Stringname
[optional] Specifies a name to be used for informational purposes. If null or the empty string, the base name of path is used. If path is null or empty, an internal name is assigned.
StringpubId
[optional] Specifies the public identifier of the document type.
StringsysId
[optional] Specifies the system identifier of the document type.
Stringstylesheet
[optional] Specifies the style sheet to be used instead of the default style sheet for the document. If flag OPEN_NOSTYLE is set, this parameter is ignored. If the specified style sheet does not exist, an exception is raised.
Returns
Document. A new Document object.
Throws
AOMException
Raised if the method detects any error.