getProperty Method (IXMLDOMSelection)
Returns a property.
JScript Syntax
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
C/C++ Syntax
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.
Remarks
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.
Versioning
Implemented in: MSXML 3.0 and MSXML 6.0