# The start tag does not match the end tag

Source: https://www.xmlvalid.com/errors/start-tag-does-not-match-the-end-tag

> An end tag does not match the start tag it should close.

The message, as .NET reports it: `The 'to' start tag on line 2 position 4 does not match the end tag of 'too'. Line 2, position 12.`

## Why it happens

- A typo or a different letter case in the end tag.
- Elements closed in the wrong order, or one never closed.

## How to fix it

- The message gives both positions: the start tag that is still open and the end tag that was found. Make the end tag match the start tag, or close the element before its parent ends.
- .NET throws an `XmlSchemaValidationException` at the first schema error unless `XmlReaderSettings.ValidationEventHandler` is set, which then receives every one with its line and position. A well-formedness error is an `XmlException` and ends reading whatever the settings.

## The same problem in xmlvalid

libxml2, which xmlvalid validates with, reports it as [Opening and ending tag mismatch](https://www.xmlvalid.com/errors/opening-and-ending-tag-mismatch): `Opening and ending tag mismatch: to line 2 and too`

## Example that fails

```xml
<note>
  <to>Ana</too>
</note>
```

## Fixed

```xml
<note>
  <to>Ana</to>
</note>
```
