Microsoft XML 2.5 SDK


 

value Property

[This is preliminary documentation and subject to change.]

Contains the attribute value.

Syntax

objValue = oXMLDOMAttribute.value

objXMLDOMAttribute.value = objValue

Remarks

Variant. The property is read/write. It returns the value of the attribute. For attributes with subnodes, the string is the concatenated text of all subnodes with character and general entity references expanded (replaced with their values).

The new attribute value is added as the value of a single text node that is a child of the attribute node. The string contents are unparsed.

Example

The following example gets the value of the first attribute of the document root and assigns it to the variable myVar:

Dim xmlDoc
Dim myVar
Set xmlDoc = CreateObject("microsoft.xmldom")
xmlDoc.async = False
xmlDoc.load("c:\books.xml")
Set root = xmlDoc.documentElement
myVar = root.attributes.item(0).value
MsgBox myVar

Applies To

XMLDOMAttribute