This property is a Microsoft extension to the W3C DOM.
Object Attr CDATASection
CharacterData Comment Document DocumentFragment
DocumentType Entity EntityReference Node
Notation ProcessingInstruction Text
Object.dataType
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
Data types for an element can be specified in a schema for an XML document. The following
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).
Code (VBScript):
Set objXMLDoc = CreateObject("Microsoft.XMLDOM")
objXMLDoc.async = False
objXMLDoc.load("states.xml")
Dim strDataType
strDataType = objXMLDoc.documentElement.childNodes.item(0).dataType
Output:
null
|