Click to return to the XML (Extensible Markup Language) home page    
XMLDOMAttribute name Prop...     XMLDOMAttribute Object    
Web Workshop  |  XML (Extensible Markup Language)

value Property


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

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLDOMAttribute


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.