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

getFeature Method

Returns the Boolean value of a feature.

The Microsoft® COM/Visual Basic® and COM/C++ implementation support the following features:

[Visual Basic]

The Boolean value indicates if a feature is enabled or disabled. For example, setting the "http://xml.org/sax/features/namespaces" feature to True enables namespace processing during parsing.

Usage Syntax

strFeature = oSAXXMLReader.getFeature(strName)

Parameters

strName
The name of the current feature.

Return Values

The following table shows the current matrix of behavior for the getFeature method.

Feature Returns
external-general-entities
external-parameter-entities
exhaustive-errors
namespaces
namespace-prefixes
parameter-entities
preserve-system-identifiers
schema-validation
server-http-request
Boolean (True/False). If successful, returns the value of the feature.
Other features Trappable error.

Remarks

The IVBSAXXMLReader interface recognizes the following features:

"exhaustive-errors"
True — Report all validation errors.
False — (default) Report only basic validation errors.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/external-general-entities"
True — Include all external general (text) entities.
False — (default) Do not include external general entities.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/external-parameter-entities"
True — Include all external parameter entities, including the external document
   type definition (DTD) subset.
False — (default) Do not include any external parameter entities, including the
   external DTD subset.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/lexical-handler/parameter-entities"
True — (default) For all parameter entities, all ISAXLexicalHandler event methods events are fired.
False — For all parameter entities, the following ISAXLexicalHandler event methods are not fired: startEntity, endEntity, skippedEntity. This includes parameter entities defined in external document type definition (DTD) subsets.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/namespaces"
True — (default) Makes namespace URIs and local names available during various method callbacks. For example, callbacks made using the startElement and endElement methods of the ISAXContentHandler interface, or the methods of the ISAXAttributes interface. In addition, namespace declarations are returned by the startPrefixMapping and endPrefixMapping methods of the ISAXContentHandler interface.
False — Does not make namespace URIs and local names available during various method callbacks.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/namespace-prefixes"
True — (default) Namespace declarations are ignored and namespace-prefixed attributes are treated the same as other attributes.
False — Namespace declarations are omitted from the attribute collection, provided that the namespace feature is True.
Access   (parsing) Read-only. (not parsing) Read/write.
"preserve-system-identifiers"
True — System identifiers reported by the reader are not resolved. This applies to all system identifiers used with any lexical, declaration, or DTD handlers, as well as any entity resolvers that might be implemented. Internally, however, the system identifiers are still resolved.
False — (default) System identifiers reported by the reader are resolved.
Access — (parsing) Read-only; (not parsing) Read/write.
"schema-validation"
True — Include all external general (text) entities.
False — (default) Do not validate when parsing.
Access — (parsing) Read-only; (not parsing) Read/write.
"server-http-request"
True — Use the server-safe ServerXMLHTTP object for the parseURL method.
False — (default) Use WinInet component to get data through HTTP for
   parseURL.
Access — (parsing) Read-only; (not parsing) Read/write.
[C/C++]

The feature name is any fully-qualified Uniform Resource Identifier (URI). The values for the namespaces and namespace-prefixes features may be available only in a specific context, such as before, during, or after a parse.

Syntax

HRESULT getFeature(
   [in] const wchar_t * pwchName,
   [out, retval] VARIANT_BOOL * pvfValue);

Parameters

pwchName [in]
The feature name (zero-terminated Unicode string).
pvfValue [out, retval]
The value of the feature (True or False).

Return Values

The following table lists the return values for the getFeature method.

Feature Returns
exhaustive-errors
external-general-entities
external-parameter-entities
namespaces
namespace-prefixes
parameter-entities
preserve-system-identifiers
server-http-request
S_OK — Last successful putFeature argument.
schema-validation S_OK — False
Other features E_INVALIDARG

Remarks

The following describes the settings and access for the features:

"http://xml.org/sax/features/namespaces"
True — (default) Makes namespace URIs and local names available during various method callbacks. For example, callbacks made using the startElement and endElement methods of the ISAXContentHandler interface, or the methods of the ISAXAttributes interface. In addition, namespace declarations are returned by the startPrefixMapping and endPrefixMapping methods of the ISAXContentHandler interface.
False — Does not make namespace URIs and local names available during various method callbacks.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/namespace-prefixes"
True — (default) Namespace declarations are ignored and namespace-prefixed attributes are treated the same as other attributes.
False — Namespace declarations are omitted from the attribute collection, provided that the namespace feature is True.
Access   (parsing) Read-only. (not parsing) Read/write.
"http://xml.org/sax/features/external-general-entities"
True — Include all external general (text) entities.
False — (default) Do not include external general entities.
Access — (parsing) Read-only; (not parsing) Read/write.
"http://xml.org/sax/features/external-parameter-entities"
True — Include all external parameter entities, including the external document
   type definition (DTD) subset.
False — (default) Do not include any external parameter entities, including the
   external DTD subset.
"exhaustive-errors"
True — Report all validation errors.
False — (default) Report only basic validation errors.
Access — (parsing) Read-only; (not parsing) Read/write.
"schema-validation"
True — Include all external general (text) entities.
False — (default) Do not validate when parsing.
Access — (parsing) Read-only; (not parsing) Read/write.
"server-http-request"
True — Use the server-safe ServerXMLHTTP object for the parseURL method.
False — (default) Use the WinInet component to get data through HTTP for
   parseURL.
Access — (parsing) Read-only; (not parsing) Read/write.

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

See Also

putFeature Method

Applies to: ISAXXMLReader Interface