Export (0) Print
Expand All
DOM
Expand Minimize

get Method

This method is deprecated in MSXML 6.0, where it throws a Not Implemented exception. Instead of using this method in MSXML 6.0, use the getSchema Method.

Returns a read-only XML Document Object Model (DOM) node that contains the <Schema> element.

var objXMLDOMNode = objXMLDOMSchemaCol.get(namespaceURI);

Parameters

namespaceURI

The namespace URI associated with the schema to return.

This can be any string that can be used in an xmlns attribute, but it cannot contain entity references. The same white space normalization that occurs on the xmlns attribute also occurs on this argument (that is, leading and trailing white space is trimmed, new lines are converted to spaces, and multiple adjacent white space characters are collapsed into one space).

Example

var oSchemaCache = new ActiveXObject("Msxml2.XMLSchemaCache.3.0");
var nsTarget = "";
oSchemaCache.add(nsTarget, "rootChild.xdr);
var oDOMNode = oSchemaCache.get(nsTarget);
WScript.Echo(oDOMNode.xml);

The JScript example in this topic uses the following file:

rootChild.xdr

<?xml version="1.0"?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data">
   <ElementType name="child"/>
   <ElementType name="root" model="closed">
     <element type="child"/>
  </ElementType>
</Schema>


The example in this topic outputs the contents of the rootChild.xdr schema.

HRESULT get(BSTR namespaceURI, IXMLDOMNode ** schemaNode);

Parameters

namespaceURI[in]

The namespace URI associated with the schema to return.

This may be any string that can be used in an xmlns attribute, but it cannot contain entity references. The same white space normalization that occurs on the xmlns attribute also occurs on this argument (that is, leading and trailing white space is trimmed, new lines are converted to spaces, and multiple adjacent white space characters are collapsed into one space).

schemaNode[out, retval]

A read-only IXMLDOMNode that represents the schema that is returned.

Return Values

S_OK

The value returned if successful.

This will not necessarily be the same document object provided by the add method, because the add method might have copied the schema. For inline schemas, this will apply directly to the <Schema> node embedded within the document.

Implemented in: MSXML 3.0. Not implemented in MSXML 6.0.

Show:
© 2014 Microsoft