XPathNavigator extensions - siof/common.extensions GitHub Wiki

XPathNavigator

Mostly created because of irritation of writing multiple times function with empty 'namespaceUri' which is required in standard methods.

GetAttribute

string GetAttribute(this XPathNavigator navigator, string name)

Same as XPathNavigator.GetAttribute but with empty namespaceUri.

MoveToAttribute

bool MoveToAttribute(this XPathNavigator navigator, string name)

Same as XPathNavigator.MoveToAttribute but with empty namespaceUri.

SelectChildren

XPathNodeIterator SelectChildren(this XPathNavigator navigator, string name)

Same as XPathNavigator.SelectChildren but with empty namespaceUri.

SetOrCreateAttribute

void SetOrCreateAttribute(this XPathNavigator navigator, string name, string value)

Sets value of attribute or creates it (with given value) if it don't exists.

RemoveAttribute

void RemoveAttribute(this XPathNavigator navigator, string name)

Removes attribute if exists

CreateAttribute

void CreateAttribute(this XPathNavigator navigator, string name, string value)

Creates attribute without any prefix or namespaceUri.