putProperty Method
Sets the value of a property.
Implementation Syntax
Sub putProperty(strName As String, varValue As Variant)
Usage Syntax
oMXValidator.putProperty(strName, varValue)
Parameters
- strName
- A string representing the name of the property.
- varValue
- The value that will be assigned to the property.
Return Values
The following table describes the results of calling the putProperty method.
| Property | Returns |
|---|---|
schemas |
Raises a trappable error if the property value cannot be set. |
schema-declaration-handler |
Sets the value of the property. |
| Other properties | Trappable error. |
Example
This example illustrates how to use the MXValidator CoClass. The sample code performs the following tasks.
- Creates a standalone SAX validator using an instance of
MXValidator. - Loads and assigns books.xsd as the XSD schema for use by the validator.
- Synthetically generates an XML document using SAX.
- Uses the standalone SAX validator to validate the document.
- Returns information on validation success or failure as output.
The example uses a resource file, books.xsd. We've provided source files for the sample in Visual Basic.
Syntax
HRESULT putProperty( [in] BSTR strName, [in] VARIANT varValue);
Parameters
- strName [in]
- A string representing the name of the property.
- varValue [in]
- The value that will be assigned to the property.
Return Values
The following table describes the results of calling the putProperty method.
| Property | Returns |
|---|---|
"schemas" |
S_OK (Not parsing.)
E_FAIL (Parsing.) |
"schema-declaration-handler" |
S_OK (Regardless of parsing mode.) |
| Other properties | E_FAIL |
Remarks
The following properties are defined for the MXValidator:
"schemas"- Gets or sets the collection of one or more schemas to be used by the
MXValidatorwhen it validates the XML stream.Datatype —
XMLSchemaCache.Access — (parsing) Read-only; (not parsing) Read/Write.
"schema-declaration-handler"- Gets or sets the schema-based declaration handler to be used by the
MXValidator.Datatype — Event handler that implements the
IMXSchemaDeclHandlerinterface.
To view reference information for Visual Basic or C/C++ only, click the Language Filter button
in the upper-left corner of the page.
See Also
Applies to: MXValidator CoClass
