startDTD Method

 

Receives the beginning of a document type declaration. If the document has no such declaration, this method will not be invoked.

All declarations reported through DTDHandler or DeclHandler events must appear between the startDTD and endDTD events. Declarations are assumed to belong to the internal document type definition (DTD) subset unless they appear between the startEntity and endEntity events. Comments and processing instructions from the DTD should also be reported between the startDTD and endDTD events.

Note

The startDTD/endDTD events appear within the startDocument/endDocument events of the ContentHandler and before the first startElement event.

Visual Basic Implementation Syntax

Sub startDTD(strName As String, strPublicId As String, strSystemId As_  
String)  

Parameters

strName
The document type name.

strPublicId
The declared public identifier for the external DTD subset or Null (if none was declared).

strSystemId
The declared system identifier for the external DTD subset or Null (if none was declared).

Return Values

If failed, the LexicalHandler raises a trappable error.

C/C++ Syntax

HRESULT startDTD(  
   [in] const wchar_t * pwchName,  
   [in] int cchName,  
   [in] const wchar_t * pwchPublicId,  
   [in] int cchPublicId,  
   [in] const wchar_t * pwchSystemId,  
   [in] int cchSystemId);  

Parameters

pwchName[in]
The document type name.

cchName[in]
The length of the document type's name.

pwchPublicId[in]
The declared public identifier for the external DTD subset or Null (if none was declared).

cchPublicId[in]
The length of the public identifier.

pwchSystemId[in]
The declared system identifier for the external DTD subset or Null (if none was declared).

cchSystemId[in]
The length of the system identifier.

Return Values

S_OK
The value returned if no errors occur.

E_FAIL
The value returned if the parse operation should be aborted.

Remarks

Note

Any declarations are assumed to be in the internal subset unless otherwise indicated by a startEntity event.

The startDTD method is called within the startDocument and endDocument events from the ContentHandler and before the first startElement event.

A document type declaration connects a document to its document type definition (DTD), which defines the rules of the document, such as what tags can go in your document, what tags can contain other tags, and the number and sequence of the tags. This declaration always begins with "<!DOCTYPE", followed by the name of the DTD, followed by a declaration of the DTD or a link to where the DTD can be found. Finally, it ends with a ">" to close the declaration. For example:

<!DOCTYPE NAME [  
DTD content goes here.  
]>  

Versioning

Implemented in: MSXML 3.0 and later

Applies to

ISAXLexicalHandler Interface

See Also

endDocument Method
endDTD Method
startDocument Method
startElement Method
startEntity Method