Subject: Re: [xml2rfc-dev] xml2rfc Input Document Issues

From: Josh Bothun <[email-masked]>
Date: Wed, 3 Aug 2011 10:37:02 -0700

On Jul 30, 2011, at 6:38 AM, Tony Hansen wrote:

> ...
> 
> On 7/30/2011 2:13 AM, Mike Biglan wrote:
>> Hi Henrik and Tony,
>> 
>> Here is a little more detail on what we worked on this past week in response to the input documents. We went ahead and tested a set of 450 documents in an attempt to categorize the errors, then fix any that needed fixing. Below are the categories that had errors and the counts in parentheses; this includes issues we have fixed, errors in the document or outside our codebase, and open questions.
>> 
>> FIXED
>> 
>> 1) Include instructions are being handled properly now.
>> 
>> 2) No DTD file was declared in the document (12)
>> We had already planned to handle this but it wasn't possible until a recent change.  I will implement a function in the application to default to rfc2629.dtd if no dtd is declared.
> 
> I'll note also that the --dtd parameter didn't seem to work either.

This has been fixed in the latest version (2.0.2).

> 
>> 9) Incorrect DTD filename given (2)
>> Could be a typo or intended to complete later, some files used 'rfcXXXX.dtd' for the DTD.  If we need to, we can treat this in the same way as if no DTD were given, but it might be more appropriate to display an error.
> 
> Can you be more specific about which documents displayed the above errors so we can see exactly what you're referring to?

Sure -- the following documents have a DOCTYPE referencing "rfcXXXX.dtd":
   draft-dnoveck-nfsv4-storage-control-01.xml
   draft-dnoveck-storage-control-01.xml
   draft-jdfalk-maawg-cfblbcp-01.xml
   draft-kanno-secsh-camellia-02.xml
   draft-kanno-tls-camellia-03.xml
   draft-worley-service-example-07.xml

> 
> ERROR: Unable to parse the XML document: draft-livingood-woundy-p4p-experiences-10.xml
> internal error, line 6, column 70
> 
> 
> I hadn't spotted these before. "Internal error" is just as bad as a exceptions.

I'm currently looking into these to see how we can better express the errors.  It looks like the pattern from documents that throw this is that they have syntax errors in the DOCTYPE declaration.

> 
> Tons of errors like
> 
> ERROR: Unable to validate the XML document: draft-maino-lisp-sec-00.xml
> Line 407: IDREF attribute target references an unknown ID "RFC5226"
> 
> 
> that need to be understood.
> 
>   Tony

This large class of errors you are getting seems to be an issue with the citation loading -- I would be curious if you ran the latest HEAD again with some of my new changes if the problem still exists.

I am able to replicate the error by invalidating my XML_LIBRARY path, or by removing the citation document entirely, however the script will also then print a warning saying that the include could not be resolved.  I've made it warning level instead of error level because it doesn't actually halt the parser, since processing instructions are not limited by the DTD, however it may be more appropriate for this to be an error.
		
If the error is still coming up, I believe that means the citation document was not found in $XML_LIBRARY OR in the same directory as the input XML file.  Running the script with --verbose may help because it prints the path to the reference its trying to load.

-josh

---

From: Tony Hansen <[email-masked]>
Date: Thu, 04 Aug 2011 14:18:23 -0400

I'm trying to do an install with the latest version and I get the error 
message

     error: can't combine user with prefix/exec_prefix/home or 
install_(plat)base

I've been installing it using

     python setup.py install --home ~

Please advise.

     Tony

---

From: Tony Hansen <[email-masked]>
Date: Thu, 04 Aug 2011 14:20:59 -0400

PS. If I leave off --home ~, it installs into ~/.local.

     Tony

On 8/4/2011 2:18 PM, Tony Hansen wrote:
> I'm trying to do an install with the latest version and I get the 
> error message
>
>>>> Here is a little more detail on what we worked on this past week in 
>>>> response to the input documents. We went ahead and tested a set of 
>>>> 450 documents in an attempt to categorize the errors, then fix any 
>>>> that needed fixing. Below are the categories that had errors and 
>>>> the counts in parentheses; this includes issues we have fixed, 
>>>> errors in the document or outside our codebase, and open questions.
>>>>
>>>> FIXED
>>>>
>>>> We had already planned to handle this but it wasn't possible until 
>>>> a recent change.  I will implement a function in the application to 
>>>> default to rfc2629.dtd if no dtd is declared.
>>>> Could be a typo or intended to complete later, some files used 
>>>> 'rfcXXXX.dtd' for the DTD.  If we need to, we can treat this in the 
>>>> same way as if no DTD were given, but it might be more appropriate 
>>>> to display an error.
>>> Can you be more specific about which documents displayed the above 
>>> errors so we can see exactly what you're referring to?
>>> ERROR: Unable to parse the XML document: 
>>> draft-livingood-woundy-p4p-experiences-10.xml
>> I'm currently looking into these to see how we can better express the 
>> errors.  It looks like the pattern from documents that throw this is 
>> that they have syntax errors in the DOCTYPE declaration.
>>
>>> Tons of errors like
>>>
>> This large class of errors you are getting seems to be an issue with 
>> the citation loading -- I would be curious if you ran the latest HEAD 
>> again with some of my new changes if the problem still exists.
>>
>> I am able to replicate the error by invalidating my XML_LIBRARY path, 
>> or by removing the citation document entirely, however the script 
>> will also then print a warning saying that the include could not be 
>> resolved.  I've made it warning level instead of error level because 
>> it doesn't actually halt the parser, since processing instructions 
>> are not limited by the DTD, however it may be more appropriate for 
>> this to be an error.
>>
>> If the error is still coming up, I believe that means the citation 
>> document was not found in $XML_LIBRARY OR in the same directory as 
>> the input XML file.  Running the script with --verbose may help 
>> because it prints the path to the reference its trying to load.
>>
>> -josh
> _______________________________________________
> xml2rfc-dev mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/xml2rfc-dev

---

From: Tony Hansen <[email-masked]>
Date: Thu, 04 Aug 2011 14:34:23 -0400

> If the error is still coming up, I believe that means the citation document was not found in $XML_LIBRARY OR in the same directory as the input XML file.  Running the script with --verbose may help…

How is the $XML_LIBRARY path used? What should it point to? (What is 
expected to be found where it points?) How do what's found in the ENTITY 
references relate?

     Tony

---

From: Josh Bothun <[email-masked]>
Date: Thu, 4 Aug 2011 13:23:02 -0700

On Aug 4, 2011, at 11:34 AM, Tony Hansen wrote:

> How is the $XML_LIBRARY path used? What should it point to? (What is expected to be found where it points?) How do what's found in the ENTITY references relate?
> 
>    Tony
> 
> 

Following the documentation of the old tool here: http://xml.resource.org/authoring/README.html#include.file.facility, an <?rfc include> instruction that contains a filename (not a full URL) will first look for the filename in $XML_LIBRARY, if it is set, and then look in the same directory as the input file.

Likewise, an ENTITY reference that only contains a filename instead of a full URL follows the same behavior -- first trying $XML_LIBRARY, then the directory of the input file.

-josh