namespaces Property
Returns the list of namespaces used in the document as XMLSchemaCache.
[Script]
Script Syntax
objXMLDOMSchemaCollection = objIXMLDOMDocument2.namespaces;
Example
// Load a document (and any schemas referenced via X-Schema).
xmldoc.load ("somedata.xml");
// Get the namespace of the root element.
var namespaceURI = xmldoc.documentElement.namespaceURI;
// Find the schema associated with the namespace.
var schema = xmldoc.namespaces.get(namespaceURI);
[Visual Basic]
Visual Basic Syntax
Set objXMLDOMSchemaCollection = objIXMLDOMDocument2.namespaces
Example
Dim xmlDoc As New Msxml2.DOMDocument40
Dim namespaceURI As String
Dim schema As XMLSchemaCache40
' Load a document (and any schemas referenced via X-Schema).
xmlDoc.Load ("books.xml")
' Get the namespace of the root element.
namespaceURI = xmlDoc.documentElement.namespaceURI
' Find the schema associated with the namespace.
Set schema = xmlDoc.namespaces.get(namespaceURI)
[C/C++]
C/C++ Syntax
HRESULT get_namespaces (IXMLDOMSchemaCollection ** namespaceCollection);
Parameters
- namespaceCollection [out, retval]
- Collection of all namespaces for the document.
Remarks
If there are no schemas, it returns an empty collection.
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.
See Also
Applies to: IXMLDOMSchemaCollection/XMLSchemaCache