XDocument.GetNamedNodeProperty Method
InfoPath Developer Reference |
Returns the value of a named property for the specified XML node, which must be a nonattribute node in the main data source.
Version Information
Version Added: InfoPath 2003
Syntax
expression.GetNamedNodeProperty(varMainDOMNode, bstrPropertyName, bstrDefaultValue)
expression An expression that returns a XDocument object.
Parameters
Name | Required/Optional | Data Type | Description |
---|---|---|---|
varMainDOMNode | Required | Variant | An XML node corresponding to a nonattribute node in the main data source, for which a named property is to be set. |
bstrPropertyName | Required | String | Specifies the name of the property whose value is to be returned. |
bstrDefaultValue | Required | String | Specifies the default value to be returned if the property has not been set. |
Return Value
String
Remarks
The GetNamedNodeProperty returns a string corresponding to the current value of the named property for the specified XML node in the main data source. If the specified property has not been set for this XML node, the specified default string is returned.
Named properties allow users to associate strings with user-defined properties of XML element nodes in the main data source. The value of a named property can be set by using the SetNamedNodeProperty method. Use the GetNamedNodeProperty method to read the value of a named property.
Security Level 2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
Example
The following example demonstrates setting and getting the value of a named property (with the name "cost") of an XML node (called "item"):
JScript |
---|
|
In the following XSL example, the "cost" named property of the item node is displayed:
JScript |
---|
|
See Also