xmlunit-core : Org.XmlUnit.Diff Namespace

MultiLevelByNameAndTextSelector Class

ElementSelector that allows two elements to be compared if their name (including namespace URI, if any) and textual content is the same at a certain level of nesting.

Syntax

public class MultiLevelByNameAndTextSelector

Remarks

This means ElementSelectors.ByNameAndText and MultiLevelByNameAndTextSelector(1).CanBeCompared should lead to the same results.

Any attribute values are completely ignored. Only works on elements with exactly one child element at each level.

This class mostly exists as an example for custom ElementSelectors and may need to be combined inside a ConditionalSelector in order to be useful for the document as a whole.

Requirements

Namespace: Org.XmlUnit.Diff
Assembly: xmlunit-core (in xmlunit-core.dll)
Assembly Versions: 2.9.2.240

Members

See Also: Inherited members from object.

Public Constructors

Uses element names and the text nested levels child elements deeper into the element to compare elements.
Uses element names and the text nested levels child elements deeper into the element to compare elements.

Public Methods

CanBeCompared (System.Xml.XmlElement, System.Xml.XmlElement) : bool
Documentation for this section has not yet been entered.

Extension Methods

static
Singleton<T> (this T) : IEnumerable<T>
An enumerable containing a single element.

Member Details

MultiLevelByNameAndTextSelector Constructor

Uses element names and the text nested levels child elements deeper into the element to compare elements.

Syntax

public MultiLevelByNameAndTextSelector (int levels)

Parameters

levels
number of levels to traverse before the text content is encountered

Remarks

Does not ignore empty text nodes.

Requirements

Namespace: Org.XmlUnit.Diff
Assembly: xmlunit-core (in xmlunit-core.dll)
Assembly Versions: 2.9.2.240

MultiLevelByNameAndTextSelector Constructor

Uses element names and the text nested levels child elements deeper into the element to compare elements.

Syntax

public MultiLevelByNameAndTextSelector (int levels, bool ignoreEmptyTexts)

Parameters

levels
number of levels to traverse before the text content is encountered
ignoreEmptyTexts
whether whitespace-only textnodes should be ignored.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Diff
Assembly: xmlunit-core (in xmlunit-core.dll)
Assembly Versions: 2.9.2.240

CanBeCompared Method

Documentation for this section has not yet been entered.

Syntax

public bool CanBeCompared (System.Xml.XmlElement controlElement, System.Xml.XmlElement testElement)

Parameters

controlElement
Documentation for this section has not yet been entered.
testElement
Documentation for this section has not yet been entered.

Returns

Documentation for this section has not yet been entered.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: Org.XmlUnit.Diff
Assembly: xmlunit-core (in xmlunit-core.dll)
Assembly Versions: 2.9.2.240