DOM
Expand Minimize

getSchema Method

[This feature was implemented only for MSXML 6.0.]

Returns an ISchema object.

In MSXML 6.0, if you add a schema to the schema cache that imports a schema with a different target namespace, and you call this method, you will get only the objects from the specified target namespace. If you want to get the ISchema object populated with the imported namespace schema, you must call this method, passing the imported namespace.

var oSchema = oSchemaCache.getSchema(strNamespaceURI);

Parameters

strNamespaceURI

A string. The namespace of the schema to be retrieved from the schema cache.

Return Values

oSchema

An object. The schema object for the Namespace URI sent to the getSchema method.

Example

The following JScript example shows the getSchema method being used to return a schema object.

var oSchemaCache = new ActiveXObject("Msxml2.XMLSchemaCache.6.0");
var nsTarget = "http://xsdtesting";
oSchemaCache.add(nsTarget, "doc.xsd");
var oSchema = oSchemaCache.getSchema(nsTarget);
WScript.Echo(oSchema.targetNamespace);

HRESULT getSchema(BSTR namespaceURI, ISchema** schema);

Parameters

strNamespaceURI[in]

A string. The namespace of the schema to be retrieved from the schema cache.

oSchema[out,retval]

An object. The schema object for the specified schema.

Return Values

S_OK

The value returned if successful.

E_POINTER

The value returned if the schema is NULL

E_FAIL

The value returned if another problem is detected.

Implemented in: MSXML 6.0

Show:
© 2014 Microsoft