次の方法で共有


getSchema Method1

 

[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.

JScript Syntax

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);  

C/C++ Syntax

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.

Versioning

Implemented in: MSXML 6.0

Applies to

IXMLDOMSchemaCollection2-XMLDOMSchemaCollection

See Also

ISchema Interface
Using Namespaces in Schemas