Subject: [xml2rfc] is there a bibtex-to-xml2rfc <reference> element converter?

From: =JeffH <[email-masked]>
Date: Wed, 05 Dec 2012 18:32:10 -0800

Hi,

Does anyone know of or have a bibtex-to-xml2rfc <reference> element converter?

i.e., I'd like to have something that converts bibtex-formatted references, e.g.:

@INPROCEEDINGS{forcehttps,
   author = {Collin Jackson and Adam Barth},
   title = {{ForceHTTPS}: Protecting High-Security Web Sites from Network Attacks},
   booktitle = {Proceedings of the 17th International World Wide Web Conference 
(WWW)},
   year = {2008},
   month = {April}
}

..to xml2rfc <reference> elements, e.g.:

       <reference anchor="ForceHTTPS" 
target="https://crypto.stanford.edu/forcehttps/">
         <front>
           <title>
               ForceHTTPS:
               Protecting High-Security Web Sites from Network
               Attacks
           </title>
           <author initials="C" surname="Jackson" fullname="Collin Jackson">
             <organization />
           </author>
           <author initials="A" surname="Barth" fullname="Adam Barth">
             <organization />
           </author>
           <date month="April" year="2008" />
         </front>
         <seriesInfo name="In Proceedings of
       the 17th International World Wide Web Conference (WWW2008)" value="" />
       </reference>

As it stands, I performed the above conversion (and a few others) by hand for a 
recent RFC, and it'd be great to have a tool that would automate this.

Thanks,

=JeffH

---

From: Nico Williams <[email-masked]>
Date: Mon, 10 Dec 2012 00:58:04 -0600

> Does anyone know of or have a bibtex-to-xml2rfc <reference> element

I took your bibtex, added it as a bibtex DB to an empty LyX document,
added a citation to the one doc, exported to LyXHTML format, and got
this (reformatted a bit):

                <div class='bibtex'>
                    <div class='bibtexentry'>
                        <a id='forcehttps' />
                            <span class='bibtexlabel'>1</span>
                            <span class='bibtexinfo'>Collin Jackson
and Adam Barth, "ForceHTTPS: Protecting High-Security Web Sites from
Network Attacks", in <i>Proceedings of the 17th International World
Wide Web Conference (WWW)</i> (, 2008).</span>
                        </div>
                    </div>
                </div>

which... kinda sucks because we lose the metadata.  So then I exported
as plain HTML (but still got XHTML!) and got this (reformatted a bit):

<p class="biblio">
    <span class="entry">[
        <a class="biblioentry" name="biblio-1">
            <span class="bib-index">1</span>
        </a>]
    </span>
    <span class="bib-authors">Collin Jackson, Adam Barth</span>.
    <span class="bib-title">ForceHTTPS: Protecting High-Security Web
Sites from Network Attacks</span>.
    <i>
        <span class="bib-booktitle">Proceedings of the 17th
International World Wide Web Conference (WWW)</span>
    </i>,
    <span class="bib-year">2008</span>.
</p>

ah!  much better!

So, we could probably hack up a quick script to generate a LyX doc
just to export to (X)HTML, apply an XSL to massage into xml2rfc
schema, and presto: a bibtex->xml2rfc converter.

Nico
--

---

From: Nico Williams <[email-masked]>
Date: Mon, 10 Dec 2012 01:35:30 -0600

Also, below are some useful resources.  Some of the programs listed in
these pages can export bibtex to XML.  In particular this one:
bibutils (http://sourceforge.net/p/bibutils/home/Bibutils/), which
includes a bib2xml utility.

http://wiki.lyx.org/BibTeX/Programs
http://wiki.lyx.org/Windows/BibTeX

bib2xml does this with your forcehttps bibentry:

<mods ID="forcehttps">
    <titleInfo>
        <title>ForceHTTPS</title>
        <subTitle>Protecting High-Security Web Sites from Network
Attacks</subTitle>
    </titleInfo>
    <name type="personal">
        <namePart type="given">Collin</namePart>
        <namePart type="family">Jackson</namePart>
        <role>
            <roleTerm authority="marcrelator" type="text">author</roleTerm>
        </role>
    </name>
    <name type="personal">
        <namePart type="given">Adam</namePart>
        <namePart type="family">Barth</namePart>
        <role>
            <roleTerm authority="marcrelator" type="text">author</roleTerm>
        </role>
    </name>
    <originInfo>
        <dateIssued>2008-April</dateIssued>
    </originInfo>
    <typeOfResource>text</typeOfResource>
    <relatedItem type="host">
        <titleInfo>
            <title>Proceedings of the 17th International World Wide
Web Conference (WWW)</title>
        </titleInfo>
        <genre authority="marcgt">conference publication</genre>
    </relatedItem>
    <identifier type="citekey">forcehttps</identifier>
    <part>
        <date>2008-April</date>
    </part>
</mods>

Wow!  It even figures out that that doc has two authors.  Writing an
XSL for massaging this into xml2rfc is left as an exercise to the
reader :)

Nico
--