Returns a collection of declared namespace prefixes bound to a namespace name.
var objNSPrefixes = objNSManager.getDeclaredPrefixes();
None.
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); }
The returned collection is never empty. If no prefixes have been declared, the returned collection contains the prefix "xml" (permanently bound to "http://www.w3.org/XML/1998/namespace"
).
If the URI reference in a default namespace declaration is empty, unprefixed elements in the scope of the declaration are not considered to be in any namespace. This causes the prefix xmlns to be used only for namespace bindings. This prefix is not itself bound to any namespace name.
set objNSPrefixes = objNSManager.getDeclaredPrefixes
None.
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"
The returned collection is never empty. If no prefixes have been declared, the returned collection contains the prefix "xml" (permanently bound to "http://www.w3.org/XML/1998/namespace"
). If the URI reference in a default namespace declaration is empty, unprefixed elements in the scope of the declaration are not considered to be in any namespace. This causes the prefix xmlns
to be used only for namespace bindings. This prefix is not itself bound to any namespace name.
HRESULT getDeclaredPrefixes( IMXNamespacePrefixes** prefixes);
IMXNamespacePrefixes
.The returned collection is never empty. If no prefixes have been declared, the returned collection contains the prefix 'xml' (permanently bound to 'http://www.w3.org/XML/1998/namespace'
). If the URI reference in a default namespace declaration is empty, unprefixed elements in the scope of the declaration are not considered to be in any namespace. This causes the prefix xmlns
to be used only for namespace bindings. This prefix is not itself bound to any namespace name.
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.
getPrefixes Method | getDeclaredPrefix Method (C++)
Applies to: IVBMXNamespaceManager