There are several ways of accessing an attribute value. The IXMLDOMAttribute interface has a nodeValue property, a value property which is equal to nodeValue and a text property which is the Microsoft extension. These properties return the following:
property | text returned |
---|---|
attrNode.nodeValue attrNode.value getAttribute("name") |
Returns exact content (with entities expanded) as found in the original document. |
attrNode.nodeTypedValue | Null |
attrNode.text | Same as nodeValue except the leading and trailing white space is trimmed. |
The XML Language specification defines the following behavior for XML Applications:
Attribute type | Text returned |
---|---|
CDATA | ID, IDREF, IDREFS, ENTITY, ENTITIES, NOTATION, enumeration |
half normalized | fully normalized |
Where half normalized means that newlines and tab characters are converted to spaces, but multiple spaces are not collapsed into one space.