getProperty Method (IXMLDOMSelection)

 

Returns a property.

strValue = objXMLDOMSelection.getProperty(name);  

Parameters

name
The string name of the property. This name is case-sensitive.

Example

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.6.0");  
var oSelection;  
xmlDoc.setProperty("SelectionLanguage", "XPath");  
xmlDoc.async = false;  
xmlDoc.load("books.xml");  
if (xmlDoc.parseError.errorCode != 0) {  
   var myErr = xmlDoc.parseError;  
   WScript.Echo("You have error " + myErr.reason);  
} else {  
   oSelection = xmlDoc.selectNodes("//book");  
   WScript.Echo(oSelection.getProperty("SelectionLanguage"));  
}  

Output

XPath  

HRESULT getProperty(BSTR name, VARIANT* value);  

Parameters

name[in]
The string name of the property. This name is case-sensitive.

value[out, retval]
The variant return value of the requested property.

Return Values

S_OK
The value returned if method successful.

E_INVALIDARG
The value returned if named property does not exist.

The getProperty method returns the value for the internal SelectionLanguage property (flag) that was set by calling the setProperty method on the document or the default value.

Implemented in: MSXML 3.0 and MSXML 6.0

IXMLDOMSelection

setProperty Method1

Show: