metanorma / metanorma-ietf

Metanorma processor for IETF documents
BSD 2-Clause "Simplified" License
6 stars 5 forks source link

Execution error: No `document.rfc.xml` file #187

Closed manuelfuenmayor closed 1 year ago

manuelfuenmayor commented 1 year ago

Issue found in https://github.com/metanorma/mn-templates-ietf/issues/28

I'm trying to build a simple document from mn-templates-ietf, using this command:

$ bundle exec metanorma -t ietf -x html rfc/document.adoc

and I get this error:

[relaton] (IETF.TLP) not found.
Anchors: (XML Line 000114): Crossreference target RNP is undefined
Metanorma XML Style Warning: (XML Line 000065): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000072): Hanging paragraph in clause
Metanorma XML Style Warning: (XML Line 000138): Table should have title
Metanorma XML Syntax: (XML Line 000007:46): element "contributor" not allowed yet; missing required element "docidentifier"
Metanorma XML Syntax: (XML Line 000175:80): attribute "inline-header" not allowed here; expected attribute "language", "numbered", "obligation", "removeInRFC", "script" or "toc"
Metanorma XML Syntax: (XML Line 000120:101): IDREF "RNP" without matching ID
RFC XML: Line 000114:54 IDREF "RNP" without matching ID
RFC XML: xref target RNP does not exist in the document
Cannot continue processing
No such file: D:/Trabajo/Metanorma/mn-templates-ietf/rfc/document.rfc.xml

It seems that I need a .rfc.xml file to succeed in the build. Am I using the correct command?

manuelfuenmayor commented 1 year ago

Ok, actually the problem is related with this two lines:

RFC XML: Line 000114:54 IDREF "RNP" without matching ID
RFC XML: xref target RNP does not exist in the document
manuelfuenmayor commented 1 year ago

It is a markup issue, related with this adoc content:

...
* This is an external reference <<RNP>>
...

[%bibitem]
=== RNP: A C library approach to OpenPGP
id:: RNP
contributor::
contributor:organization.name:: Ribose Inc.
contributor:organization.contact::
contributor:organization.contact.street:: Suite 1111, 1 Pedder Street
contributor:organization.contact.region:: Central
contributor:organization.contact.country:: Hong Kong
contributor:organization.contact.city:: Hong Kong
contributor:organization.contact.email:: open.source@ribose.com
contributor:organization.contact.uri:: https://www.ribose.com

RNP is not being recognized as an anchor.

The problem gets solved if I prepend [[RNP]] to [%bibitem], like this:

[[RNP]]
[%bibitem]
=== RNP: A C library approach to OpenPGP
id:: RNP
contributor::
contributor:organization.name:: Ribose Inc.
...

@opoudjis, is this the correct approach for AsciiBib references?

opoudjis commented 1 year ago

I'm surprised at the crash, I'll try to replicate. The id:: field is meant to be extracted, but the [[id]] anchor is guaranteed to be extracted.

In fact, come to think of it, cross-reference resolution may well occur at an early enough time in document processing, that the id:: would indeed be resolved too late.

Providing an anchor is probably safer, but I'll add that the delimiters between fields should always be ".", so 'contributor.organization.name'.

I will add that the new span notation is going to be more reliable than this notation, which relies on getting the current structure of Relaton fields exactly right. So

* [[RNP,RNP]] span:organization[Ribose Inc.], span:title[RNP: A C library approach to OpenPGP]

Of course, there are no address fields for contacts defined in that notation currently... but then again, it's not like those address fields are displayed in the bibliography to begin with.

But yes, if you must have the address in the bibliographic item, this is how to do it. Follow https://www.relaton.org/specs/asciibib/ as close as you can.

opoudjis commented 1 year ago

Cannot replicate. If I take out the [[RNP]]:


[%bibitem]
=== RNP: A C library approach to OpenPGP
id:: RNP
contributor::

I get a validation complaint:

Crossreferences: (XML Line 000114): RNP does not have a corresponding anchor ID in the bibliography!

--- which I also get if I leave the [[RNP]] in; but the document still compiles, and the target is recognised:

<relref target="RNP" section="" relative="">

The cross-reference complaint is not because the AsciiBib bibitem is not recognised, but because it lacks a mnemonic docid: Metanorma expects a mnemonic docid to insert into the document as a citation. I will relax that constraint; the absence of docid is already alerted about elsewhere. (With no docid, citation is already falling back to using the anchor as the ID. Author-date, if and when we implement it, will be handled as a docid.)

opoudjis commented 1 year ago

@manuelfuenmayor Please review, I am not getting a crash when I try to replicate.

manuelfuenmayor commented 1 year ago

@opoudjis the crash is gone. Perhaps it is due to the update you performed in metanorma-standoc. Thanks!