共用方式為


omitXMLDeclaration Property

 

Forces the IMXWriter to skip the XML declaration. This can be useful when you want to output fragments of larger XML documents that can be assembled into a single XML document later.

Visual Basic Implementation Syntax

Property Let IMXWriter_omitXMLDeclaration(ByVal RHS As Boolean)  
Property Get IMXWriter_omitXMLDeclaration() As Boolean  

Visual Basic Usage Syntax

oMXXMLWriter.omitXMLDeclaration= boolValue  
boolValue = oMXXMLWriter.omitXMLDeclaration  

C/C++ Syntax

 [propput]  
HRESULT omitXMLDeclaration (  
   [in] VARIANT_BOOL fValue);  
 [propget]  
HRESULT omitXMLDeclaration (  
   [out, retval] VARIANT_BOOL * fValue);  

Parameters

fValue
Boolean.

Return Values

S_OK
The value returned if no errors are reported.

Remarks

Value Description
True Omit XML declaration.
False (default) Provide XML declaration.

This property is read/write.

The omitXMLDeclaration property has no effect on DOM output.

The IXSLProcessor object implements the omitXMLDeclaration property as follows:

  • When set, overrides the omit-xml-declaration setting used in the active XSLT style sheet assigned to the processor. When XML is the output method, this setting controls whether an XML declaration such as <?xml version="1.0"?> appears in processor output.

  • When read, returns the current omit-xml-declaration setting, either VARIANT_TRUE (True) or VARIANT_FALSE (False). If omit-xml-declaration was not specified in the XSLT style sheet, a value of VARIANT_FALSE (False) is returned.

Versioning

Implemented in: MSXML 3.0 and later

Applies to

IMXWriter Interface

See Also

MXHTMLWriter CoClass
MXXMLWriter CoClass
Sample XML File (books.xml)