Subject: [xml2rfc] how to debug an error?

From: JORDI PALET MARTINEZ <[email-masked]>
Date: Mon, 12 Jun 2017 16:45:32 +0200

Hi,

I’m trying to upload a document with is a cut down version from a previous one …

I believe everything is ok, and can’t find the problem, but I get

WARNING: Parsing Error: Opening and ending tag mismatch: section line 1 and middle, line 1, column 33851 (line 1)
ERROR: Unable to parse the XML document: INPUT
 INPUT: Line 1: Opening and ending tag mismatch: section line 1 and middle
 INPUT: Line 1: Opening and ending tag mismatch: section line 1 and middle
 INPUT: Line 1: Opening and ending tag mismatch: middle line 1 and rfc
 INPUT: Line 1: Premature end of data in tag rfc line 1

What actually means column 33851?

Thanks!

Regards,
Jordi

**********************************************
IPv4 is over
Are you ready for the new Internet ?
http://www.consulintel.es
The IPv6 Company

This electronic message contains information which may be privileged or confidential. The information is intended to be for the use of the individual(s) named above. If you are not the intended recipient be aware that any disclosure, copying, distribution or use of the contents of this information, including attached files, is prohibited.

---

From: Fred Baker <[email-masked]>
Date: Mon, 12 Jun 2017 09:10:04 -0700

From tools.ietf.org, Bill Fenner has an XML validator. https://fenron.com/~fenner/ietf/xml2rfc-valid/. Note; the certificate is expired, and Firefox will give you heartburn over the fact. But it is usually better in its diagnostics than XML2RFC.

> On Jun 12, 2017, at 7:45 AM, JORDI PALET MARTINEZ <[email-masked]> wrote:
> 
> Hi,
> 
> _______________________________________________
> xml2rfc mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc

---

From: JORDI PALET MARTINEZ <[email-masked]>
Date: Mon, 12 Jun 2017 18:12:20 +0200

Thanks Fred, all,

I tried it, but didn’t worked …

I needed to go again line by line doing a manual checking in my xml to find the problem …

Saludos,
Jordi

---

From: Paul Kyzivat <[email-masked]>
Date: Mon, 12 Jun 2017 13:43:55 -0400

> I needed to go again line by line doing a manual checking in my xml to find the problem …

I have no *good* way, but do have some unpleasant ways that usually work 
*eventually*:

1) always make xml changes a little bit at a time. Verify each with 
xml2rfc before doing more.

2) If I've just made a change to a file that previously worked and now 
doesn't, roll back the change. Then follow (1): start introducing it 
again a little bit at a time.

3) If for some reason you are faced with an xml file that doesn't work 
and no prior version that does, then binary search it for errors. Chop 
out a chunk that would leave the file well formed if all was well 
outside of it. Do this until you find a piece that contains the errors. 
Then start looking for smaller parts inside it that contain the error. 
This process can be quite painful to execute successfully. Or you might 
get lucky.

	Thanks,
	Paul

---

From: Brian E Carpenter <[email-masked]>
Date: Tue, 13 Jun 2017 08:35:24 +1200

> xml2rfc before doing more.

I use "XML Copy Editor" to edit xml2rfc, and you can check that the 
XML is well-formed with a single click while editing. (You have to
provide it with rfc2629.dtd and the underlying .ent files.) That's
significantly easier than invoking xml2rfc repeatedly. It doesn't
catch everything, but it definitely catches a missing </anything>.

Of course, it can't guess where the missing </section> was meant to be.
I just tried deleting a </section> just before the Security Consideration
in a draft, and XML Copy Editor says this:
 Error at line 2135, column 5: mismatched tag
and that line is actually </middle>, which is where any recursive descent
will catch the missing </section>.

   Brian

---

From: [email-masked] (Dale R. Worley)
Date: Mon, 12 Jun 2017 19:41:52 -0400

JORDI PALET MARTINEZ <[email-masked]> writes:
> I'm trying to upload a document with is a cut down version from a
> previous one ...
>
> I believe everything is ok, and can't find the problem, but I get

I use Emacs.  The recent versions of Emacs have an XML mode that will
tell you whether the file is well-formed.

> WARNING: Parsing Error: Opening and ending tag mismatch: section line
> 1 and middle, line 1, column 33851 (line 1)

If a program thinks the input is one enormously long line, a common
cause is that the line-endings in the file are something that the
program doesn't recognize as line endings.

Dale