Pushes the local context down the stack.
objNSManager.pushContext();
None.
var oNSMgr;
try
{
oNSMgr = new ActiveXObject("Msxml2.MXNamespaceManager.5.0");
oNSMgr.declarePrefix( "sample", "urn:same uri");
alert(oNSMgr.getURI("sample"));
oNSMgr.pushContext();
oNSMgr.declarePrefix ("sample", "urn:new uri");
alert(oNSMgr.getURI("sample"));
oNSMgr.popContext();
alert(oNSMgr.getURI("sample"));
} catch(e)
{
alert("Error \n" + e);
}
objNSManager.pushContext
None.
Dim oNSMgr As New Msxml2.MXNamespaceManager50
oNSMgr.declarePrefix "sample", "urn:same uri"
MsgBox oNSMgr.getURI("sample")
oNSMgr.pushContext
oNSMgr.declarePrefix "sample", "urn:new uri"
MsgBox oNSMgr.getURI("sample")
oNSMgr.popContext
MsgBox oNSMgr.getURI("sample")
HRESULT pushContext();
None.
MSXML2::IMXNamespaceManagerPtr PtrIMXNamespaceManager;
HRESULT hres;
unsigned short WideCharBuffer[100];
int BufferLength = 100;
try
{
PtrIMXNamespaceManager.CreateInstance( _
__uuidof(MSXML2::MXNamespaceManager));
PtrIMXNamespaceManager->declarePrefix(_T("sample"),_T("urn"));
hres = PtrIMXNamespaceManager->_getURI(L"sample", NULL, _
WideCharBuffer, _
&BufferLength);
DisplayMessageToUser(_bstr_t(WideCharBuffer));
PtrIMXNamespaceManager->pushContext();
PtrIMXNamespaceManager->declarePrefix(_T("sample"),_T("urn2"));
BufferLength = 100;
hres = PtrIMXNamespaceManager->_getURI(L"sample", _
NULL, _
WideCharBuffer, _
&BufferLength);
DisplayMessageToUser(_bstr_t(WideCharBuffer));
PtrIMXNamespaceManager->popContext();
BufferLength = 100;
hres = PtrIMXNamespaceManager->_getURI(L"sample", _
NULL, _
WideCharBuffer, _
&BufferLength);
DisplayMessageToUser(_bstr_t(WideCharBuffer));
}
catch(...)
{
DisplayMessageToUser("Error");
}
}
void DisplayMessageToUser(char *Msg)
{
::MessageBox(NULL, Msg, _T("Message"), MB_OK);
}
The pushContext method pushes the local context down the stack, and creates a new local context.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
Applies to: IVBMXNamespaceManager
Applies to: IMXNamespaceManager