standalone Property

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

standalone Property

Sets the value of the standalone attribute in the XML declaration to "yes" or "no". If set to True, the XML declaration appears as the following in XML output:

<?xml version="1.0" encoding="UTF-16" standalone="yes"?>
[Visual Basic]

Usage Syntax

oMXXMLWriter.standalone = boolValue
boolValue = oMXXMLWriter.standalone

Remarks

Boolean. Read/write. The default value is False. The standalone declaration indicates if a document relies on information from an external source, such as external document type definition (DTD), for its content.

If set to False, the XML parser will accept external resources, if there are any, without reporting an error. If set to True, the parser reports an error if the document references an external DTD or external entities.

Example

The following example reads books.xml and writes the value of the standalone attribute to "yes" in the XML declaration.

Dim rdr As New Msxml2.SAXXMLReader50
Dim cnth As IVBSAXContentHandler
Dim wrt As New MXXMLWriter50
wrt.indent = True
wrt.standalone = True
Set cnth = wrt
Set rdr.contentHandler = cnth
rdr.parseURL ("books.xml")
MsgBox wrt.output
[C/C++]

Syntax

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

Parameters

fValue
A Boolean expression (True/False) specifying whether the feature is on or off.

Return Values

S_OK
The value returned if no errors are reported.

Remarks

Value Description
True The value of standalone is set to "yes".
False (default) The value of standalone is set to "no".

To view reference material for Visual Basic or C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

Applies to: MXXMLWriter CoClass