OpenXmlElement.ReplaceChild<T> method

Office 2013 and later

Replaces a child element with another child element in the current element's list of child elements.

Namespace:  DocumentFormat.OpenXml
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

public virtual T ReplaceChild<T>(
	OpenXmlElement newChild,
	T oldChild
)
where T : OpenXmlElement

Type parameters

T

Parameters

newChild
Type: DocumentFormat.OpenXml.OpenXmlElement

The new OpenXmlElement to put in the child list.

oldChild
Type: T

The OpenXmlElement being replaced in the list.

Return value

Type: T
The OpenXmlElement element that was replaced.
Show: