IPMath.Nz(IXMLDOMNodeList) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the node set passed to the function, except with zeros (0) where empty values existed before.
public:
System::Object ^ Nz(Microsoft::Office::Interop::InfoPath::Xml::IXMLDOMNodeList ^ pxmllistInput);
public object Nz (Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNodeList pxmllistInput);
abstract member Nz : Microsoft.Office.Interop.InfoPath.Xml.IXMLDOMNodeList -> obj
Public Function Nz (pxmllistInput As IXMLDOMNodeList) As Object
Parameters
- pxmllistInput
- IXMLDOMNodeList
The node set that will have its empty values replaced with zeroes.
Returns
An object that represents a node set.
Examples
In the following example, the variable noZero
is set to a node set that is identical to the my:ages
node set, with all blank values replaced by zeros. This example is based on a repeating section with a field named "ages." An alert is shown for the XML generated for the first entry in the node list:
IXMLDOMNodeList ages = thisXDocument.DOM.selectNodes("//my:ages");
IXMLDOMNodeList noZero = (IXMLDOMNodeList)thisXDocument.Util.Math.<span class="label">Nz</span>(ages);
thisXDocument.UI.Alert(noZero[0].xml.ToString());
Remarks
An exception occurs if there are no empty values in the node set.
Note: Accessing the object returned by the Nz method by casting it to the IXMLDOMNodeList type in a managed form may result in security exceptions, in which case the form should be given FullTrust permissions.