Subject: [xml2rfc] Alternate XML schemas, or XSLTs? Latexml -> xml2rfc conversion?

From: Nico Williams <[email-masked]>
Date: Thu, 3 May 2012 15:33:33 -0500

Has anyone written an XSLT to convert from latexml's schema to xml2rfc schema?

The latexml schema is here: http://dlmf.nist.gov/LaTeXML/manual/schema/ .

The reason I ask is that I'm wondering if LyX could be made to output
Internet-Drafts by way of exporting to tex, then applying latexml,
then postprocess with an XSLT stylesheet to convert to xml2rfc schema,
finally typeset with xml2rfc.  Then we'd have a WYSYWIG Internet-Draft
editing tool.

Nico
--

---

From: Miek Gieben <[email-masked]>
Date: Thu, 3 May 2012 23:10:40 +0200

[ Quoting <[email-masked]> in "[xml2rfc] Alternate XML schemas, or..." ]
> finally typeset with xml2rfc.  Then we'd have a WYSYWIG Internet-Draft

Seems like a simular route I took in pandoc2rfc
(https://github.com/miekg/pandoc2rfc). The style sheet translates from
DocBook XML to xml2rfc. Maybe you can use that as a starting point?

gtrz Miek

---

From: Nico Williams <[email-masked]>
Date: Thu, 3 May 2012 16:19:11 -0500

> DocBook XML to xml2rfc. Maybe you can use that as a starting point?

Oh, I'll take a look, thanks!

There's a LaTeX to DocBook XML conversion tool, TeX4ht, that I might
be able to use to convert to docbook, then I might be able to use your
pandoc2rfc tool.

I've been using VIM for years to edit xml2rfc XML, but I'm getting
bored of that :)

Nico
--

---

From: Miek Gieben <[email-masked]>
Date: Thu, 3 May 2012 23:21:32 +0200

[ Quoting <[email-masked]> in "Re: [xml2rfc] Alternate XML schemas..." ]
> I've been using VIM for years to edit xml2rfc XML, but I'm getting

I did that too, right now I only edit Pandoc sources
(http://johnmacfarlane.net/pandoc/), which is such a bless :)

See https://github.com/miekg/nsec4 for a real life example.

 Regards,

-- 
    Miek Gieben

---

From: Nico Williams <[email-masked]>
Date: Thu, 3 May 2012 16:42:11 -0500

So I've got a simple test-i-d.lyx file, dead simple: it has a title,
an author, an abstract, a section and a subsection.  I export it as
LaTeX, then I run

htlatex test\-i\-d.tex xhtml,docbook " -cunihtf" -cdocbk

then I tried to apply your transform:

xsltproc --nonet ../../ws/pandoc2rfc/transform.xsl test\-i\-d.xml

but this only produces plain text output on stdout that looks like this:

draft-williams-httpbis-auth-classiﬁcation
Nicolas Williams
May 3, 2012

Abstract
This document proposes a classiﬁcation scheme for HTTPbis
authentication proposals,
to help with analysis and selection.
   0.1Introduction
0.1.1Conventions used in this document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in RFC2119.

What am I doing wrong?

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Thu, 3 May 2012 16:43:33 -0500

The .xml output by htlatex looks like this (I had to change the URL
for docbook.dtd):

<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V5.0//EN"
"file:///home/nico/MS/Assessment/docbook.dtd" >

<!--translated from test-i-d.tex, on 2012-05-03 16:32:00,
by TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)
xhtml,docbook,html,refcaption -->
 <?xtpipes file="docbook.4xt" ?>

<article
 role="report" xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0"><title
></title>

<para role="maketitle"><note
role="title"><para>draft-williams-httpbis-auth-classi&#xFB01;cation</para></note>
<note role="author"><para><personname><othername>Nicolas
Williams</othername></personname></para></note>
<note role="date"><para>May 3, 2012</para></note></para><abstract

<note
 role="title"><para>Abstract</para></note>
<!--l. 17
--><para>This document proposes a classi&#xFB01;cation scheme for
HTTPbis authentication proposals,
to help with analysis and selection.</para><!--l. 19
--><para/></abstract>
...

---

From: Nico Williams <[email-masked]>
Date: Thu, 10 May 2012 23:53:03 -0500

I'm actually making good progress now on an XSTL (2.0, sadly)
stylesheet to convert LyX XHTML output (which is less lossy than the
other LyX->XML and LyX->TeX->XML conversions I've tried) into xml2rfc
output.

I've to work out some issues with tables and references, and I have to
add support for more author meta-data (which I now know how to do).

Once I have this working it'd also be nice to develop a LyX layout and
class for properly displaying and printing, respectively,
Internet-Drafts/RFCs written in Lyx -- not really necessary, I know,
given xml2rfc, but for RFCs with complex math formulas and such it
might be a good idea.

LyX is a WYSIWYM -- what you see is what you mean -- editor.  It's
only missing a vi mode and it'd be my ideal editor for complex
documents.  Being able to author Internet-Drafts in LyX might make
editing I-Ds easier and more accessible for many people.

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Fri, 11 May 2012 02:51:24 -0500

Making a lot more progress.  Thanks a lot for your help!