# XmlErrorEventArgs Class

> The XmlErrorEventArgs class provides data for the TextControl.XmlNotWellFormed and TextControl.XmlInvalid events.

- **Product:** TX Text Control .NET Server
- **Section:** Reference
- **Kind:** Class
- **Namespace:** `TXTextControl`
- **Package:** `TXTextControl.TextControl.Core.SDK` (assembly `TXTextControl.Core.dll`, from the private NuGet feed or Text Control Offline Packages)
- **Package:** `TXTextControl.TextControl.ASP.SDK` (assembly `TXTextControl.dll`, from the private NuGet feed or Text Control Offline Packages)
- **.NET Framework:** reference `TXTextControl.dll` from the setup
- **Inherits:** `System.EventArgs`
- **Path:** TX Text Control .NET Server > Reference > TXTextControl > XmlErrorEventArgs Class
- **705 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/llms-full.txt

---

### Description

The XmlErrorEventArgs class provides data for the [TextControl.XmlNotWellFormed](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/xmlnotwellformed-event/llms-full.txt) and [TextControl.XmlInvalid](https://docs.textcontrol.com/tx-text-control-dotnet-winforms/reference/txtextcontrol/textcontrol/xmlinvalid-event/llms-full.txt) events.

### Syntax

```csharp
public class XmlErrorEventArgs : EventArgs
```

```vbnet
Public Class XmlErrorEventArgs
    Inherits EventArgs
```

### Examples

The following example uses `XmlErrorEventArgs.FilePosition` while handling `XmlNotWellFormed`.

```csharp
textControl.XmlNotWellFormed += (_, e) =>
{
    Console.WriteLine($"File Position: {e.FilePosition}");
};
```

```vbnet
AddHandler textControl.XmlNotWellFormed,
    Sub(sender, e)
        Console.WriteLine($"File Position: {e.FilePosition}")
    End Sub
```

---

## In This Section

- [XmlErrorEventArgs.FilePosition Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/fileposition-property/llms-full.txt): Gets the absolute file position in the XML document where the error occurred. If the property value is zero, there is no information about the file position.
- [XmlErrorEventArgs.LineNumber Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/linenumber-property/llms-full.txt): Gets the line number in the XML document that contains the error. If the property value is zero, there is no information about the line number.
- [XmlErrorEventArgs.LinePosition Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/lineposition-property/llms-full.txt): Gets the character position within the line where the error occurred. If the property value is zero, there is no information about the line position.
- [XmlErrorEventArgs.Reason Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/reason-property/llms-full.txt): Gets the reason for the error.
- [XmlErrorEventArgs.URL Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/url-property/llms-full.txt): Gets the URL of the XML document containing the error. If the property value is an empty string there is no information about the URL.

---

## Nearby

- **Previous:** [XmlElementCollection.Remove Method](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlelementcollection/remove-method/llms-full.txt)
- **Next:** [XmlErrorEventArgs.FilePosition Property](https://docs.textcontrol.com/tx-text-control-dotnet-server/reference/txtextcontrol/xmlerroreventargs/fileposition-property/llms-full.txt)
