getURIFromNode Method

MSXML 5.0 SDK

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

getURIFromNode Method

Returns the namespace URI for the provided prefix and DOM node.

[Script]

Script Syntax

var strURI = objNSManager.getURIFromNode(strPrefix, objIXMLDOMNode);

Parameters

strPrefix
The namespace prefix.
objIXMLDOMNode
The provided DOM node.

Return Values

A variant. The namespace URI.

[Visual Basic]

Visual Basic Syntax

strURI = objNSManager.getURIFromNode(strPrefix, objIXMLDOMNode)

Parameters

strPrefix
The namespace prefix.
objIXMLDOMNode
The provided DOM node.

Return Values

A variant. The namespace URI.

[C/C++]

C/C++ Syntax

HRESULT getURIFromNode(
    BSTR strPrefix,
    IXMLDOMNode* contextNode,
    VARIANT* uri);

Parameters

strPrefix[in]
The namespace prefix.
contextNode[in]
The provided DOM node.
uri[out,retval]
The namespace URI.

C/C++ Return Values

S_OK
The value returned if successful.
S_FALSE
The value returned if the prefix is not bound to the current context.
E_INVALIDARG
The value returned if the contextNode parameter is NULL.
E_POINTER
The value returned if the passed object or pointer to the return string is NULL.

Remarks

The getURIFromNode method uses the DOM node to provide the context, rather than using the local context of the current instance NamespaceManager object. This method does not affect the current context or stack on this instance of the NamespaceManager object.

To use the context of the same node several times, use a separate instance of the NamespaceManager object, or reset the current one. Resetting the current instance of NamespaceManager will cause the loss of the current stack.

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

See Also

getURI Method | pushNodeContext Method

Applies to: IVBMXNamespaceManager