Contains this node's value expressed in its defined data type.
objValue = oXMLDOMNode.nodeTypedValue objXMLDOMNode.nodeTypedValue = objValue
Variant. The property is read/write. It returns the value of this node in its defined data type, if such a data type is defined. If the node has no content, this property returns Null.
This value depends on the value of the XMLDOMNode object's nodeType property.
This member is an extension of the W3C DOM.
NODE_ATTRIBUTE | Returns the value in the data representation of the type specified in the schema for the attribute. (Data types are specified using the dt:dt attribute, and because attributes cannot be applied to attributes, the attribute's data type can be specified only in the schema.) If no type was specified, returns a string identical to the nodeValue property. If the new value is not of the type specified in the schema or cannot be coerced to the type specified in the schema, then an error occurs. |
NODE_CDATA_SECTION, NODE_COMMENT, NODE_DOCUMENT, NODE_DOCUMENT_FRAGMENT, NODE_DOCUMENT_TYPE, NODE_ENTITY, NODE_NOTATION, NODE_PROCESSING_INSTRUCTION | Returns a string that is equal to the nodeValue property. These node types do not have data types. |
NODE_ELEMENT | Returns the value in the data representation of the type specified on the element instance (using the dt:dt attribute) or specified in the schema. If no type was specified on the instance or in the schema, returns a string identical to the nodeValue property. If the element has an attribute data type, returns null. |
NODE_ENTITY_REFERENCE | Returns the value in the data representation of the type specified for the referenced entity. This is limited to entities with a single data type on the root level element of the subtree corresponding to the entity. If no data type was specified, returns a string identical to the nodeValue property. |
NODE_TEXT | Returns the value in the data representation of the type of the containing element. If the containing element was not typed, returns a string identical to the nodeValue property. |
Dim xmlDoc As New MSXML2.FreeThreadedDOMDocument Dim xmlDocTest As New MSXML2.FreeThreadedDOMDocument Dim strDestination As String Dim childNode Set xmlDoc.documentElement = xmlDoc.createElement("Test") strDestination = "c:\test.xml" Set childNode = xmlDoc.createNode(3, "", "") xmlDoc.documentElement.appendChild childNode xmlDoc.documentElement.dataType = "bin.hex" childNode.nodeTypedValue = "ffab123d" xmlDoc.save strDestination xmlDocTest.async = False xmlDocTest.Load strDestination MsgBox xmlDocTest.xml
Result (in a messagebox)
<Test xmlns:dt="urn:schemas-microsoft-com:datatypes" dt:dt="bin.hex">ffab123d</Test>
Applies To: XMLDOMAttribute Object | XMLDOMCDATASection Object | XMLDOMCharacterData Object | XMLDOMComment Object | DOMDocument Object | XMLDOMDocumentFragment Object | XMLDOMDocumentType Object | XMLDOMElement Object | XMLDOMEntity Object | XMLDOMEntityReference Object | XMLDOMNode Object | XMLDOMNotation Object | XMLDOMProcessingInstruction Object | XMLDOMText Object | XTLRuntime Object