Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Current »

Overview

Used for error checks. Makes an assertion that specified xpath returns a true boolean value, otherwise an error is thrown.

void myXml.Assert(xpath: string, message: string, detail: string)

Arguments

string xpath
XPath to be evaluated as a boolean.
string message
Error message to be shown. If not specified, "Assertion Failed" standard message is used.
string detail
XPath to evalute to append in the error message.

Remarks

Checking if the Name of a Customer is 'X'. If it is not, message "Invalid customer" will be shown, with appending the real XPath to the Name of a Customer:

Example

Simple Usage

$Xml.Assert("//Customer/Name = 'X'", "Invalid customer", "//Customer/Name");
  • No labels