Re: [xml2rfc] how to debug an error?

Brian E Carpenter <brian.e.carpenter@gmail.com> Mon, 12 June 2017 20:35 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: xml2rfc@ietfa.amsl.com
Delivered-To: xml2rfc@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3C76E1298BA for <xml2rfc@ietfa.amsl.com>; Mon, 12 Jun 2017 13:35:30 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BU3psz_eUC2J for <xml2rfc@ietfa.amsl.com>; Mon, 12 Jun 2017 13:35:28 -0700 (PDT)
Received: from mail-pf0-x22c.google.com (mail-pf0-x22c.google.com [IPv6:2607:f8b0:400e:c00::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0B24C1298A1 for <xml2rfc@ietf.org>; Mon, 12 Jun 2017 13:35:28 -0700 (PDT)
Received: by mail-pf0-x22c.google.com with SMTP id 15so28644075pfc.1 for <xml2rfc@ietf.org>; Mon, 12 Jun 2017 13:35:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:organization:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=hLJxyzrU6QO0hQwZcfDTdH0Gmcym+XFPEf7AHBcSrg4=; b=GgZm2i2IpUNlDEWdgFbR/ArLTNnH+NJxBYrAkaen9j4fYUMFiQxSUa/WpNo9jWyOwD 2iNJQBKsD8lcMf+oY+jBMbVLcpkMgJRPyzahKf6ZfOH+TiWB/TevJvGQlggHl0zOl82w kM7vjkG51hpgua/dRXh/ErteJhtQf/ljkLwMhRBlFi6IjogagfPK08S9IpTRBW7LQNTI hQW5TF1LOfRvmqZv58asEwQaI1nHLYvCZwbX4Bo/v4uw50GXL0VxAuShq1mEX7tYXPC7 n4OcLJg3PB7CyYE9vUlWDV4ZXCfHwuNJkLazP/YghBypRQKpBDycLpMZuwAIgK+7QKoc aAzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=hLJxyzrU6QO0hQwZcfDTdH0Gmcym+XFPEf7AHBcSrg4=; b=QjykeZ40Y/G2RU6gAyOT0N9k2TYfFe3YmduH77oZ6Cy+v5eDLRQ4WjZgKuLSp/63mk XU0EcklywwqL2SL8BDcy546sekARovcEG+aptGjPoGnXevP4v3T6v/MaWFHDEpodONM7 xpmDy/RV0lioJIKaF5xEInP16h0Vwtq09eu1Wwz574j4R9BDzXxSdb3uv3TsPeflR72L J4tAG3GLkOK/UnlgCedQOgqclwfYMaNEdVnqQB8cJLWNLmc7hnwxV95nCFB9DZqpeRFw XlHD+SlmMPqb4yvSpw2bdEY9mpOduFYDvd8DGfwS5o8JrJxQ1/yX7KixfWossTqGWuyE 1vpg==
X-Gm-Message-State: AODbwcBeK31bJFa8+3lRBEcJJG79flvZaw7tac9MsGdV3cE99AxlZo6g CiYhvhRWTgzWzej3ES0=
X-Received: by 10.84.229.8 with SMTP id b8mr59534236plk.239.1497299727322; Mon, 12 Jun 2017 13:35:27 -0700 (PDT)
Received: from ?IPv6:2406:e007:7b4b:1:28cc:dc4c:9703:6781? ([2406:e007:7b4b:1:28cc:dc4c:9703:6781]) by smtp.gmail.com with ESMTPSA id s9sm5147902pfe.21.2017.06.12.13.35.25 for <xml2rfc@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Jun 2017 13:35:26 -0700 (PDT)
To: xml2rfc@ietf.org
References: <0748C4BB-5FE8-4122-8988-1B79D35A73FB@consulintel.es> <D9F49864-35D4-4D3C-A401-64E95B37D4ED@gmail.com> <051590FC-72DD-4BC3-8797-32013E0A873A@consulintel.es> <5fb483fc-171b-ec07-ec6f-4031ac343bf6@comcast.net>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Organization: University of Auckland
Message-ID: <32114599-8352-9d6f-2895-ef34a28ea9f3@gmail.com>
Date: Tue, 13 Jun 2017 08:35:24 +1200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <5fb483fc-171b-ec07-ec6f-4031ac343bf6@comcast.net>
Content-Type: text/plain; charset="utf-8"
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/xml2rfc/GsO0C55djtN-VsneZLd2KcV1fCg>
Subject: Re: [xml2rfc] how to debug an error?
X-BeenThere: xml2rfc@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: <xml2rfc.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/xml2rfc/>
List-Post: <mailto:xml2rfc@ietf.org>
List-Help: <mailto:xml2rfc-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/xml2rfc>, <mailto:xml2rfc-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 12 Jun 2017 20:35:30 -0000

On 13/06/2017 05:43, Paul Kyzivat wrote:
> On 6/12/17 12:12 PM, JORDI PALET MARTINEZ wrote:
>> 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 …
> 
> 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.

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

> 
> 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
> 
> 
> 
>> Saludos,
>> Jordi
>>   
>>
>> -----Mensaje original-----
>> De: Fred Baker <fredbaker.ietf@gmail.com>
>> Responder a: <fredbaker.ietf@gmail.com>
>> Fecha: lunes, 12 de junio de 2017, 18:10
>> Para: JORDI PALET MARTINEZ <jordi.palet@consulintel.es>
>> CC: <xml2rfc@ietf.org>
>> Asunto: Re: [xml2rfc] how to debug an error?
>>
>>      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 <jordi.palet@consulintel.es> wrote:
>>      >
>>      > 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.
>>      >
>>      >
>>      >
>>      > _______________________________________________
>>      > xml2rfc mailing list
>>      > xml2rfc@ietf.org
>>      > https://www.ietf.org/mailman/listinfo/xml2rfc
>>      
>>      
>>      
>>
>>
>>
>> **********************************************
>> 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.
>>
>>
>>
>> _______________________________________________
>> xml2rfc mailing list
>> xml2rfc@ietf.org
>> https://www.ietf.org/mailman/listinfo/xml2rfc
>>
> 
> _______________________________________________
> xml2rfc mailing list
> xml2rfc@ietf.org
> https://www.ietf.org/mailman/listinfo/xml2rfc
>