XML DOM » Node » dataType

Compability: Internet Explorer

Syntax:
node.dataType

This is a read-only property that specifies the data type for the node.

The dataType property is a read-only property of type variant that specifies the data type for the node. This can be a string containing the data type name, if declared, for valid nodes types, or null where no data type was declared or the node type is invalid. Ultimately, it depends on the value of the nodeType property of the Node object. Valid data types are:

  • NODE_ATTRIBUTE
  • NODE_ELEMENT
  • NODE_ENTITY_REFERENCE

Examples

Code:
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("states.xml")

Dim strDataType
strDataType = objXMLDoc.documentElement.childNodes.item(0).dataType
Output:
null
Explanation:

Data types for an element can be specified in a schema for an XML document. This example gets the data type of the first child node of the root element and displays it (in this case null as the data type has not been declared).

Language(s): VBScript