共用方式為


omitXMLDeclaration Property

 

Forces the MXXMLWriter to omit the XML declaration. This property can be used to output fragments of larger XML documents that can be assembled into a single XML document later.

Visual Basic Usage Syntax

oMXXMLWriter.omitXMLDeclaration= boolValue  
boolValue = oMXXMLWriter.omitXMLDeclaration  

Results

The following shows a fragment of books.xml with the XML declaration omitted from the output.

<catalog>  
   <book id="bk101">  
      <author>Gambardella, Matthew</author>  
      <title>XML Developer's Guide</title>  
      <genre>Computer</genre>  
      <price>44.95</price>  
      <publish_date>2000-10-01</publish_date>  
      <release_years>1998 2000</release_years>  
      <description>An in-depth look at creating applications with XML.</description>  
   </book>  

C/C++ Syntax

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

Parameters

fValue
Boolean. Read/write.

Return Values

S_OK
The value returned if no errors are reported.

Remarks

Boolean. Read/write.

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

Versioning

Implemented in: MSXML 3.0 and later

Applies to

MXXMLWriter CoClass

See Also

Sample XML File (books.xml)