Subject: [xml2rfc] LyX -> RFC online, work in progress

From: Nico Williams <[email-masked]>
Date: Thu, 17 May 2012 12:20:41 -0500

https://github.com/nicowilliams/lyx2rfc

It works well enough that I can actually write a lengthy I-D (in
progress) that xml2rfc (old version) formats with minimal complaints:

xml2rfc: warning: <appendix/> element is deprecated, use <section/>
instead around input line 422
xml2rfc: warning: <?rfc symrefs=?> now defaults to "yes" around input line 436

Also, I need to add various metadata to cover PIs like whether to
generate toc and so on, but it's really quite functional now.

I suppose I should include a screenshot, but, there's plenty at
lyx.org to get started with.

Note that normally I'm very much a VIM in a screen(1) kind of a
person.  I just got tired of <xml/>, what can I say.  LyX doesn't have
VI keybindings, which sucks for me, but I still want to try this out
for a while.

Nico
--

---

From: Julian Reschke <[email-masked]>
Date: Thu, 17 May 2012 19:28:48 +0200

On 2012-05-17 19:20, Nico Williams wrote:
> xml2rfc: warning:<appendix/>  element is deprecated, use<section/>

Indeed. Don't use <appendix>.

> xml2rfc: warning:<?rfc symrefs=?>  now defaults to "yes" around input line 436

Do you have the PI set at all?

> ...

Best regards, Julian

---

From: Nico Williams <[email-masked]>
Date: Thu, 17 May 2012 12:41:34 -0500

>> https://github.com/nicowilliams/lyx2rfc

I added screenshots just now.

> Indeed. Don't use <appendix>.

I know :)  I'll get to that...  since it's only a warning and renders
fine...  I had many more warnings earlier, not to mention errors.

BTW, you seem to know a lot about XSLT...  I had to resort to XSLT 2.0
and some ugly twists to handle conversion of h2, h3, and h4 elements
into section elements.  Any ideas for how to do that in XSLT 1.0?  I
couldn't find any recipes general enough (i.e., covering nested
sections).

> Do you have the PI set at all?

No, I have to add that too.

Nico
--

---

From: Julian Reschke <[email-masked]>
Date: Thu, 17 May 2012 19:48:23 +0200

On 2012-05-17 19:41, Nico Williams wrote:
> On Thu, May 17, 2012 at 12:28 PM, Julian Reschke<[email-masked]>  wrote:
>> Indeed. Don't use<appendix>.
>

If you have a minimized example, I can try.

In general, everything is possible in XSLT 1.0, it just can get very 
painful. Grouping is a weakness.

> No, I have to add that too.

xml2rfc was supposed to warn about the absence of the PI just for a 
transition period; I guess this should be fixed in the TCL code.

Best regards, Julian

---

From: Nico Williams <[email-masked]>
Date: Thu, 17 May 2012 13:07:11 -0500

> If you have a minimized example, I can try.

I've added a sample .xhtml file to my repo.  You can see sequences of
elements like:

    <h2 class="section">
      <span class="section_label">2</span> <a id="magicparlabel-93453"/>
Details</h2>
    <div class="standard">
      <a id="magicparlabel-93454"/>
Some text. Here's a protected&nbsp;space, and here's a bunch of them:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;, see?</div>
    <h3 class="subsection">
      <span class="subsection_label">2.1</span> <a
id="magicparlabel-93455"/><a id="sub_A_sub_section"/>
A sub-section</h3>
    <div class="standard">
      <a id="magicparlabel-93456"/>
and</div>
    <h4 class="subsubsection">
      <span class="subsubsection_label">2.1.1</span> <a
id="magicparlabel-93457"/>
A sub-sub-section</h4>
    <div class="standard">
      <a id="magicparlabel-93458"/>
cool.</div>

To simplify:

<h2>section title</h2>...paragraphs...<h3>subsection title</h3>...

There's no closing of sections.

> painful. Grouping is a weakness.

I looked and looked.  I couldn't find a recipe that supports nesting
of sections.  I ended up relying on the XPath 2.0 << operator, and
even so it feels very hackish.  But surely this must be a common
problem!!  (The O'Reilly XSLT Cookbook covers this, but not with
support for nesting, so I know it has come up before.)

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Thu, 17 May 2012 14:58:31 -0500

Actually, I can't find docs saying what should be used to produce an
appendix other than the appendix element.  E.g,
http://xml.resource.org/authoring/draft-mrose-writing-rfcs.html
doesn't say.  The page for the dev version of xml2rfc also doesn't
say.  Where should I be looking?

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Thu, 17 May 2012 15:03:09 -0500

Never mind: it's section elements in the back element, following references.

---

From: Julian Reschke <[email-masked]>
Date: Thu, 17 May 2012 22:06:21 +0200

> appendix other than the appendix element.  E.g,

Just put a <section> into <back>.

> say.  Where should I be looking?

I think you're looking in the right place, it's just not there.

Best regards, Julian

---

From: Nico Williams <[email-masked]>
Date: Thu, 17 May 2012 15:18:13 -0500

> I think you're looking in the right place, it's just not there.

Yeah.  Somehow it became obvious after posting.  Using <section> in
<back> actually simplified the XSLT stylesheet significantly.  I've
added PI support, and now I just need to figure the namespace issues
so I can fully script this, deal with whatever minor issues as I go.

Thanks!

Do you think the IETF tools team would like to incorporate this tool?
I'd be happy to contribute it.  I'd think that a WYISWYM tool for I-D
authoring would be somewhat desirable...

Nico
--