Returns a collection of namespace prefixes bound to the specified URI.
var objNSPrefixCol = obnNSManager.getPrefixes(namespaceURI)
An object. Returns the collection of prefixes.
var oNSMgr; try { oNSMgr = new ActiveXObject("Msxml2.MXNamespaceManager.5.0"); oNSMgr.declarePrefix( "sample", "urn"); oNSMgr.declarePrefix ("a", "abc"); alert(oNSMgr.getDeclaredPrefixes.length); // 3 alert(oNSMgr.getDeclaredPrefixes[0]); // "sample" alert(oNSMgr.getURI("sample")); // "urn" alert(oNSMgr.getPrefixes("urn")[0]); // "sample" } catch(e) { alert("Error \n" + e); }
set objNSPrefixCol = obnNSManager.getPrefixes(strNamespaceURI)
An object. Returns the collection of prefixes.
Dim oNSMgr As New Msxml2.MXNamespaceManager50 oNSMgr.declarePrefix "sample", "urn" oNSMgr.declarePrefix "a", "abc" MsgBox oNSMgr.getDeclaredPrefixes.length ' 3 MsgBox oNSMgr.getDeclaredPrefixes.Item(0) ' "sample" MsgBox oNSMgr.getPrefixes("urn").Item(0) ' "sample" MsgBox oNSMgr.getURI("sample") ' "urn"
HRESULT getPrefixes( BSTR namespaceURI, IMXNamespacePrefixes** prefixes);
namespaceURI
argument is an empty string. A prefix cannot be bound to an empty string.IMXNamespacePrefixes
.When there are no prefixes bound to the specified namespace URI, the returned collection of prefixes contains no items.
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