TX Text Control .NET for WPF

XmlElement Class

Class
Namespace
TXTextControl
Package
TXTextControl.TextControl.WPF.SDK from the private NuGet feed or Text Control Offline Packages
Assembly
TXTextControl.dll
Install
dotnet add package TXTextControl.TextControl.WPF.SDK .NET 8 and later. For .NET Framework, reference TXTextControl.dll from the setup.

Description

An instance of this class represents an element in a XML document. To iterate through all occurrences of an XML element in a Text Control document the XmlElementCollection class can be used.

Syntax

public class XmlElement

Examples

The following example creates a Xml Element instance and configures its text setting for a document workflow.

XmlElement xmlElement = new("CustomerName");
xmlElement.Text = "Quarterly results";

Members

Constructors

ConstructorDescription
XmlElementInitializes a new instance of the XmlElement class.

Properties

PropertyDescription
AutoSelectDetermines whether the text of a newly added XML element is automatically selected.
AutoTextDetermines whether text is automatically created for a newly added XML element that has no text contents. The created text consists of the element's name enclosed in square brackets and is created only if no text has been set with the XML element's Text property.
ElementNameGets the name of an XML element.
TextSpecifies the text of the XML element. If the element consists of several sub-elements, the text parts are separated through paragraph end characters (0x0A).

Methods

MethodDescription
AddChildAdds a new XML element as a sub-element of this element. The new element is placed at the position specified through the document's DTD.
GetChildItemReturns an XML Element object that represents a child element of this element.
RemoveChildRemoves an XML child element.
SelectSelects the text of the XML element. The text can only be selected, if the element belongs to the document.