People, people. The actual point is still being missed!

YES - you can count tags. YES - that would identify that there is a missed tag. Say 20 <Amend> and 19 </Amend>. But it tells you NOTHING about the logic.

Does that means there are really 19 proper tags, and an EXTRA <Amend>?

OR;

Does that mean there are 20 proper tags and a MISSING </Amend>?

See what I mean? There is no way to know unless you parse it. Parsing is a logic operation. A count is a good starting point but it does NOT help (really) at all with the logic needed.

Yes - you can highlight tags....but the logic problem remains.

You need to match, and you need to match in the proper order.
higlight all the <Amend> and </Amend> codes not just the ones that misses their start or end tags??)
I don't know how many more times I can state this. The answer is YES! You can do this. But it requires very detailed, flawlessly convoluted logic. There is no other way.

Further, as I stated before, the logic is not difficult, but it IS tedious. If you have a real need for a tool like this, then by all means do it...and use it.

I mean you could do a superficial count operation. That would at least warn you that something is wrong - but it would not tell you exactly what it is (is it an extra, or a missing tag), nor would it tell where it is.

A really functional tool requires perfect logic. This logic MUST perform a variable number of loopback operations.

A: <Amend> text text <Amend> text text ettstst </Amend>
B: <Amend> text text text text ettstst </Amend>

Which is correct? B: right? That is easy. But how do you KNOW there is not an improper tag between an <Amend> and an </Amend>, as in A:? You can not know - unless you actually check. There is no other way. You must check. Period.

Further there must be logic test to see - is the first <Amend> correct......and the second one needs to be removed; or is the second one correct, and the first one needs to be removed. Further, if the second one is correct...are you sure the first one needs to be removed...or does it actually need a closing tag? Further, if the first one is correct does the second one ned to be removed...or does IT need a closing tag?

These are logic tests. And this thing just ain't gonna fly without them.