[xml/sgml-commit] r480 - in packages: . debiandoc2dbxml
debiandoc2dbxml/debian
Philippe Batailler
philbat-guest at costa.debian.org
Mon Oct 10 19:12:49 UTC 2005
Author: philbat-guest
Date: 2005-10-10 19:12:14 +0000 (Mon, 10 Oct 2005)
New Revision: 480
Added:
packages/debiandoc2dbxml/
packages/debiandoc2dbxml/Makefile
packages/debiandoc2dbxml/book.xml
packages/debiandoc2dbxml/catalog
packages/debiandoc2dbxml/dd2xml.html
packages/debiandoc2dbxml/debian/
packages/debiandoc2dbxml/debian/README
packages/debiandoc2dbxml/debian/changelog
packages/debiandoc2dbxml/debian/control
packages/debiandoc2dbxml/debian/copyright
packages/debiandoc2dbxml/debian/postinst
packages/debiandoc2dbxml/debian/postrm
packages/debiandoc2dbxml/debian/prerm
packages/debiandoc2dbxml/debian/rules
packages/debiandoc2dbxml/debiandoc-tidy
packages/debiandoc2dbxml/debiandoc-tidy.1.sgml
packages/debiandoc2dbxml/debiandoc-xml.dtd
packages/debiandoc2dbxml/debiandoc2dbxml
packages/debiandoc2dbxml/debiandoc2dbxml.1.sgml
packages/debiandoc2dbxml/split.xml
Log:
Import debiandoc2dbxml in the repository
Added: packages/debiandoc2dbxml/Makefile
===================================================================
--- packages/debiandoc2dbxml/Makefile 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/Makefile 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,42 @@
+#!/usr/bin/make -f
+
+DESTDIR =
+BIN = debiandoc2dbxml debiandoc-tidy
+LIB = book.xml split.xml debiandoc-xml.dtd catalog
+DOC = dd2xml.html
+MANPAGES=debiandoc2dbxml.1 debiandoc-tidy.1
+
+# Put the files where they must go !
+
+build : debiandoc2dbxml.1 debiandoc-tidy.1
+
+install :
+ install -m 755 -d $(DESTDIR)/usr/share/sgml/debiandoc2dbxml
+ install -m 755 -d $(DESTDIR)/usr/share/doc/debiandoc2dbxml
+ install -m 755 -d $(DESTDIR)/usr/bin
+ install -m 755 -d $(DESTDIR)/usr/share/man/man1
+ install -m 755 $(BIN) $(DESTDIR)/usr/bin/
+ install -m 644 $(LIB) $(DESTDIR)/usr/share/sgml/debiandoc2dbxml/
+ install -m 644 $(DOC) $(DESTDIR)/usr/share/doc/debiandoc2dbxml/
+ install -m 644 $(MANPAGES) $(DESTDIR)/usr/share/man/man1/
+
+# create the man pages
+
+debiandoc2dbxml.1 :
+ /usr/bin/docbook2man debiandoc2dbxml.1.sgml
+debiandoc-tidy.1 :
+ /usr/bin/docbook2man debiandoc-tidy.1.sgml
+
+clean :
+ rm -f debiandoc2dbxml.1 debiandoc-tidy.1
+ rm -f *.links *.refs
+
+deb :
+ fakeroot debian/rules clean
+ dh_clean
+ dpkg-buildpackage -rfakeroot -I.svn
+
+scp :
+ scp dd2xml.html osamu at people.debian.org:public_html/pub/dd2xml.html
+
+.PHONY: install clean deb scp
Added: packages/debiandoc2dbxml/book.xml
===================================================================
--- packages/debiandoc2dbxml/book.xml 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/book.xml 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,384 @@
+<!--
+This file is part of Debiandoc2dbxml, version 0.2
+book.xml
+-->
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output
+version="1.0"
+method="xml"
+indent="yes"
+encoding="iso-8859-1"
+omit-xml-declaration="yes"/>
+
+
+<xsl:template match="debiandoc-xml">
+<xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="book">
+ <xsl:choose>
+ <xsl:when test="$style='book'">
+ <book>
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </book>
+ </xsl:when>
+ <xsl:otherwise>
+ <article>
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </article>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="titlepag">
+<xsl:apply-templates select="title"/>
+</xsl:template>
+
+<xsl:template match="title">
+ <xsl:choose>
+ <xsl:when test="$style='book'">
+ <title><xsl:apply-templates/></title>
+ <bookinfo>
+ <xsl:apply-templates select="following-sibling::*" mode="info"/>
+ </bookinfo>
+ </xsl:when>
+ <xsl:otherwise>
+ <title><xsl:apply-templates/></title>
+ <articleinfo>
+ <xsl:apply-templates select="following-sibling::*" mode="info"/>
+ </articleinfo>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="author" mode="info">
+<author><xsl:apply-templates mode="info"/></author>
+</xsl:template>
+
+<xsl:template match="translator" mode="info">
+<collab>
+<xsl:apply-templates mode="translator"/>
+</collab>
+</xsl:template>
+
+<xsl:template match="name" mode="translator">
+<collabname><xsl:value-of select="."/></collabname>
+</xsl:template>
+
+<xsl:template match="translator/email" mode="translator">
+<affiliation><address><email>
+<xsl:apply-templates/>
+</email></address></affiliation>
+</xsl:template>
+
+<xsl:template match="name" mode="info">
+<firstname>
+<xsl:value-of select="substring-before(.,' ')"/>
+</firstname>
+<surname>
+<xsl:value-of select="substring-after(.,' ')"/>
+</surname>
+</xsl:template>
+
+<xsl:template match="author/email" mode="info">
+<affiliation><address><email>
+<xsl:apply-templates mode="info"/>
+</email></address></affiliation>
+</xsl:template>
+
+<xsl:template match="email" mode="info">
+<address><email><xsl:apply-templates mode="info"/></email></address>
+</xsl:template>
+
+<xsl:template match="version" mode="info">
+<releaseinfo>
+<xsl:comment>
+put version
+</xsl:comment>
+</releaseinfo>
+<pubdate>
+<xsl:comment>
+put date
+</xsl:comment>
+</pubdate>
+</xsl:template>
+
+<xsl:template match="abstract" mode="info">
+<abstract>
+<para>
+<xsl:apply-templates/>
+</para></abstract>
+</xsl:template>
+
+<xsl:template match="copyright" mode="info">
+<copyright>
+<year>
+<xsl:comment>
+put date
+</xsl:comment>
+</year>
+<holder>
+<xsl:comment>
+put names
+</xsl:comment>
+</holder>
+</copyright>
+ <xsl:if test="child::p">
+<legalnotice>
+<xsl:apply-templates/>
+</legalnotice>
+</xsl:if>
+</xsl:template>
+
+<xsl:template match="copyrightsummary"/>
+
+<!-- les listes -->
+
+<xsl:template match="enumlist">
+ <orderedlist>
+ <xsl:if test="@compact">
+ <xsl:attribute name="spacing">compact</xsl:attribute>
+ </xsl:if>
+ <xsl:choose>
+ <xsl:when test="@numeration">
+ <xsl:attribute name="numeration"><xsl:value-of select="@numeration"/>
+ </xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:attribute name="numeration">arabic</xsl:attribute>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates/>
+ </orderedlist>
+</xsl:template>
+
+<xsl:template match="item">
+<listitem><xsl:apply-templates/></listitem>
+</xsl:template>
+
+<xsl:template match="list">
+<itemizedlist>
+<xsl:if test="@compact">
+<xsl:attribute name="spacing">compact</xsl:attribute>
+</xsl:if>
+<xsl:apply-templates/></itemizedlist>
+</xsl:template>
+
+<xsl:template match="taglist">
+<variablelist>
+<xsl:apply-templates select="tag[not(preceding-sibling::*[1]/self::tag)]" mode="entree"/>
+</variablelist>
+</xsl:template>
+
+<xsl:template match="tag" mode="entree">
+<varlistentry>
+<term><xsl:apply-templates/></term>
+<xsl:apply-templates select="following-sibling::*[1]" mode="liste"/>
+</varlistentry>
+</xsl:template>
+
+<xsl:template match="tag" mode="liste">
+<term><xsl:apply-templates/></term>
+<xsl:apply-templates select="following-sibling::*[1]" mode="liste"/>
+</xsl:template>
+
+<xsl:template match="item" mode="liste">
+<listitem><xsl:apply-templates/></listitem>
+</xsl:template>
+
+<xsl:template match="p">
+<para><xsl:apply-templates/></para>
+</xsl:template>
+
+<!-- chapitre et sections -->
+
+<xsl:template match="chapt">
+<xsl:choose>
+ <xsl:when test="$style='book'">
+ <chapter>
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </chapter>
+ </xsl:when>
+ <xsl:otherwise>
+ <section>
+ <xsl:if test="@id!=''">
+ <xsl:attribute name="id">
+ <xsl:value-of select="@id"/>
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates/>
+ </section>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
+<xsl:template match="appendix">
+<appendix>
+<xsl:if test="@id!=''">
+<xsl:attribute name="id">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+</xsl:if>
+<xsl:apply-templates/>
+</appendix>
+</xsl:template>
+
+<xsl:template match="sect|sect1|sect2|sect3|sect4|sect5">
+<section>
+<xsl:if test="@id!=''">
+<xsl:attribute name="id">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+</xsl:if>
+<xsl:apply-templates/>
+</section>
+</xsl:template>
+
+<xsl:template match="heading">
+<title><xsl:apply-templates/></title>
+</xsl:template>
+
+<xsl:template match="ref">
+<xref>
+<xsl:attribute name="linkend">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+<xsl:apply-templates/>
+</xref>
+</xsl:template>
+
+<xsl:template match="qref">
+<link>
+<xsl:attribute name="linkend">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+<xsl:apply-templates/>
+</link>
+</xsl:template>
+
+
+<xsl:template match="url">
+<ulink>
+<xsl:attribute name="url">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+<xsl:if test="@name=''">
+<xsl:value-of select="@id"/>
+</xsl:if>
+<xsl:value-of select="@name "/>
+</ulink>
+</xsl:template>
+
+<!-- les sur la ligne -->
+
+<xsl:template match="em">
+<emphasis><xsl:apply-templates/></emphasis>
+</xsl:template>
+
+<xsl:template match="strong">
+<emphasis><xsl:attribute name="role">bold</xsl:attribute>
+<xsl:apply-templates/>
+</emphasis>
+</xsl:template>
+
+<xsl:template match="tt">
+<literal><xsl:apply-templates/></literal>
+</xsl:template>
+
+<xsl:template match="var">
+<replaceable><xsl:apply-templates/></replaceable>
+</xsl:template>
+
+<xsl:template match="example">
+<screen><xsl:apply-templates/></screen>
+</xsl:template>
+
+<xsl:template match="comment">
+<remark><xsl:apply-templates/></remark>
+</xsl:template>
+
+<xsl:template match="comment/p">
+<phrase><xsl:apply-templates/></phrase>
+</xsl:template>
+
+<xsl:template match="file">
+<filename><xsl:apply-templates/></filename>
+</xsl:template>
+
+<xsl:template match="package">
+<systemitem>
+<xsl:attribute name="role">package</xsl:attribute>
+<xsl:apply-templates/></systemitem>
+</xsl:template>
+
+<xsl:template match="prgn">
+<command><xsl:apply-templates/></command>
+</xsl:template>
+
+<!-- les renvois -->
+
+<xsl:template match="ftpsite">
+<systemitem>
+<xsl:attribute name="class">systemname</xsl:attribute>
+<xsl:attribute name="role">ftpsite</xsl:attribute>
+<xsl:apply-templates/></systemitem>
+</xsl:template>
+
+<xsl:template match="httpsite">
+<systemitem>
+<xsl:attribute name="class">systemname</xsl:attribute>
+<xsl:attribute name="role">httpsite</xsl:attribute>
+<xsl:apply-templates/></systemitem>
+</xsl:template>
+
+<xsl:template match="ftppath|httppath">
+<filename><xsl:apply-templates/></filename>
+</xsl:template>
+
+<xsl:template match="manref">
+<citerefentry>
+<refentrytitle>
+<xsl:value-of select="@name"/>
+</refentrytitle>
+<manvolnum>
+<xsl:value-of select="@section"/>
+</manvolnum>
+</citerefentry>
+</xsl:template>
+
+<xsl:template match="comment()">
+<xsl:comment>
+<xsl:value-of select="."/>
+</xsl:comment>
+</xsl:template>
+
+<xsl:template match="date">
+<xsl:comment>
+Mettre la date dans la version
+</xsl:comment>
+</xsl:template>
+
+<xsl:template match="toc"/>
+
+<xsl:template match="@*|node()">
+<xsl:copy><xsl:apply-templates match="@*|node()"/></xsl:copy>
+</xsl:template>
+
+</xsl:stylesheet>
Added: packages/debiandoc2dbxml/catalog
===================================================================
--- packages/debiandoc2dbxml/catalog 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/catalog 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,3 @@
+DOCTYPE debiandoc-xml debiandoc-xml.dtd
+PUBLIC "-//DebianDoc//DTD DebianDocXml//EN" debiandoc-xml.dtd
+DTDDECL "-//Norman Walsh//DTD DocBook XML V4.0//EN" "/usr/share/sgml/declaration/xml.dcl"
Added: packages/debiandoc2dbxml/dd2xml.html
===================================================================
--- packages/debiandoc2dbxml/dd2xml.html 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/dd2xml.html 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,597 @@
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+ <meta name="Author" content="Osamu Aoki">
+ <meta name="GENERATOR" content="VIM">
+ <title>debiandoc-sgml to docbook-xml conversion</title>
+</head>
+<body>
+<h1>debiandoc-sgml to docbook-xml conversion</h1>
+<pre>
+==========================================================================
+ (original concept) Philippe Batailler <pbatailler at teaser.fr>
+ (original concept) Adam DiCarlo <aph at debian.org>
+ (ghost writer) Osamu Aoki <osamu at debian.org>
+ Sat Dec 14 00:54:21 2002
+==========================================================================
+</pre>
+</p>
+
+<h2><a name="toc">Table of contents</a></h2>
+<p>
+<ul>
+<li><a href="#why">Why convert?</a></li>
+<li><a href="#how">How to read this?</a></li>
+<li><a href="#step">Step by step guide.</a></li>
+<li><a href="#tags">How tags are converted?</a></li>
+</ul>
+</p>
+<hr>
+
+<h2><a name="why">Why convert?</a></h2>
+<p>
+Because it is cool to be XML :)
+</p>
+<hr>
+
+<h2><a name="how">How to read this?</a></h2>
+<p>
+Use table capable web browser if you are reading HTML.
+</p>
+<ul>
+ <li>Mozilla</li>
+ <li>Galeon</li>
+ <li>links</li>
+ <li>w3m</li>
+ <li>...</li>
+</ul>
+<hr>
+
+<h2><a name="step">Step by step guide.</a></h2>
+<p>
+This is a rehashed tutorial given by Philippe Batailler's to Osamu Aoki
+through the private e-mails in 2002.
+</p>
+<p>
+In order to convert debiandoc-sgml into docbook-xml, following
+steps needs to be taken:
+</p>
+
+<p>
+<ol>
+<li>Install debiandoc2dbxml
+<!--
+<p>
+Get a file <tt>Debiandoc2dbxml.tar.gz</tt> from
+<a href="http://www.teaser.fr/~pbatailler/">Philippe Batailler's web site</a>.
+Then untar it and copy contents to the root of SGML file source.
+</p>
+<p>
+Note: Something like following should work once this is packaged into deb.
+<pre>
+$ su -c "apt-get update && apt-get install ???debian2docbookxml???"
+</pre>
+</p>
+<p>
+Get scripts from DDP CVS server
+<pre>
+$ cd $HOME
+$ echo 'export PATH="~/Debiandoc-to-docbook:${PATH}"'>> ~/.bash_profile
+$ . ~/.bash_profile
+$ export CVSROOT=:pserver:anonymous at cvs.debian.org:/cvs/debian-doc
+$ cvs login
+$ cvs co -d Debiandoc-to-docbook utils/debiandoc-to-docbook # ***
+$ cd Debiandoc-to-docbook
+$ make
+$ cd /some/debiandoc/sgml/source-directory/ # use of mc is easy way :)
+</pre>
+***) Whoever checked out from old CVS location, please commit all
+changes and check out all new trees in a different location.
+I will remove old CVS location soon.
+</p>
+-->
+<li>Make source file compatible with script manually
+<p>
+Due to some conversion script limitations, if you experience problems
+converting files, please consider the following source touch-up rules
+presented below, although script might have fixed some of the issues
+already (it will not harm).
+</p>
+<ul>
+<li>Adjust SGML header lines (first few lines of the file)
+<p>If foo.sgml includes many files (subset of dtd), first line must end
+with [ as:
+<pre>
+<!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN" [
+... content
+]>
+</pre>
+Here splitting each start and end of these section will fail.
+</p>
+<p>
+If foo.sgml is a single file, header is:
+<pre>
+<!DOCTYPE debiandoc PUBLIC "-//DebianDoc//DTD DebianDoc//EN">
+</pre>
+</p>
+
+<li>Keep some conditionals within one line.
+<p>
+<pre>
+<[%bar;[
+</pre>
+</p>
+
+<li>Keep some some tags within one line.
+<p>
+<pre>
+<chapt>...</chapt>
+<appendix>...</appendix>
+<sect>...</sect>
+<sect1>...</sect1>
+<sect2>...</sect2>
+</pre>
+</p>
+
+<li>Remove some comment
+<p>
+<pre>
+<!-- ... -->
+</pre>
+</p>
+<p>
+This is to avoid script to malfunction by "<tt> ]> </tt>" in the comment.
+</p>
+
+<li>make attribute such as "id" a single token.
+<p>
+<pre>
+wrong: <book id="foo bar">
+correct: <book id="foo_bar">
+</pre>
+</p>
+
+</ul>
+</p>
+
+<li>Normalize SGML to XML compatible format (debiandoc-tidy)
+<p>
+<pre>
+$ debiandoc-tidy foo.sgml
+$ debiandoc-tidy -e bar.ent
+</pre>
+</p>
+
+<li>Convert SGML tags into XML tags (debiandoc2dbxml)
+<p>
+If foo.sgml is smaller article in a single file without subset of dtd.
+<pre>
+$ debiandoc2dbxml -a path/to/foo.sgml
+</pre>
+</p>
+<p>
+If foo.sgml is larger book in a single file without subset of dtd.
+<pre>
+$ debiandoc2dbxml -b path/to/foo.sgml
+</pre>
+</p>
+<p>
+If foo.sgml is larger book with many included files (subset of dtd).
+<pre>
+$ debiandoc2dbxml -s -b path/to/foo.sgml
+</pre>
+</p>
+<p>
+Now we have got a large single foo.xml
+</p>
+<p>
+If foo.sgml is larger book with many included files (subset of dtd). To
+create split file output in directory path/to/locale, you should use the
+option -S and the option -l (locale = en, fr, es...)
+<pre>
+$ debiandoc2dbxml -S -s -b -l fr path/to/foo.sgml
+</pre>
+</p>
+<p>
+Now we have got a foo.xml in <tt>path/to/</tt> with many chunks of files
+under <tt>path/to/fr/</tt>
+</p>
+<p>
+For debugging, use "-k" to keep intermediate files and use
+"-t" to trace shell activities.
+</p>
+
+<li>Test it with emacs and psgml, or nsgmls:
+<p>
+<pre>
+$ nsgmls -s /usr/share/sgml/declaration/xml.decl foo.xml
+</pre>
+<li>Format source for readability
+<p>
+In order to make source more readable, some reformatting may be good idea.
+For example, to add newline after </listitem>:
+<pre>
+$ perl -i -p -e's,</listitem>,</listitem>\n,g' foo.xml
+</pre>
+</p>
+
+<li>Building output
+<p>
+There are few strategies to build output.
+<table border="1">
+<tr>
+ <td>
+ Stylesheet
+ </td>
+ <td>
+ Back end
+ </td>
+</tr>
+<tr>
+ <td>DSSSL</td>
+ <td>jade and jadetex</td>
+</tr>
+<tr>
+ <td>CSS</td>
+ <td>mozilla?</td>
+</tr>
+<tr>
+ <td>XSL</td>
+ <td>passivetex?</td>
+</tr>
+</table>
+<p>
+Needs more documentation for creating files (plain text, multi-file,
+HTML, PS, PDF).
+</p>
+</ol>
+</p>
+<hr>
+<h2><a name="tags">How tags are converted?</a></h2>
+<p>
+Here is a conversion list of tags from debiandoc-sgml to dookbook-xml.
+Each column means as follows:
+
+<ul>
+ <li>"debiandoc-sgml tag" are the tags used in original documents.</li>
+ <li>"converted docbook-xml tag" are the tags converted programatically
+ by XLST.</li>
+ <li>"alternative docbook-xml tag" are the alternative tags which may
+ be used in places by editing dookbook-xml source later by the human.</li>
+</ul>
+</p>
+
+<table border="1">
+ <tr>
+ <td><p>original debiandoc-sgml tag</p></td>
+ <td><p>converted docbook-xml tag using XLST</p></td>
+ <td><p>alternative docbook-xml tag</p></td>
+ </tr>
+ <tr>
+ <td><p>book</p></td>
+ <td>
+ <p>book (-b option)</p>
+ <p>article (-a option)</p>
+ </td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>title</p></td>
+ <td><p>title</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>author</p></td>
+ <td><p>author</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>name</p></td>
+ <td><p>firstname + surname</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>email</p></td>
+ <td>
+ <p>affiliation + address + email (in author element)</p>
+ <p>email (other places)</p></td>
+ </td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>version</p></td>
+ <td><p>releaseinfo</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>abstract</p></td>
+ <td><p>abstract + para</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>copyright</p></td>
+ <td><p>copyright</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>toc</p></td>
+ <td>
+ <p>(presentation tool takes care)</p>
+ <p>(stylesheet is needed?) (oa)</p>
+ </td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>chapt</p></td>
+ <td>
+ <p>chapter (-b option)</p>
+ <p>section (-a option)</p>
+ </td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>appendix</p></td>
+ <td><p>appendix</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>sect</p></td>
+ <td><p>section</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>sect1</p></td>
+ <td><p>section</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>sect2</p></td>
+ <td><p>section</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>sect3</p></td>
+ <td><p>section</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>sect4</p></td>
+ <td><p>section</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>p</p></td>
+ <td><p>para</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>em</p></td>
+ <td><p>emphasis</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>strong</p></td>
+ <td>
+ <p>emphasis role="strong" (aph)</p>
+ <p>emphasis role="bold" (pb)</p>
+ </td>
+ <td><p>emphasis role="important"</p></td>
+ </tr>
+ <tr>
+ <td><p>var</p></td>
+ <td><p>replaceable</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>package</p></td>
+ <td><p>systemitem role="package"</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>prgn</p></td>
+ <td><p>command</p></td>
+ <td><p>??? (what to use for well known file w/o path)</p></td>
+ </tr>
+ <tr>
+ <td><p>file</p></td>
+ <td><p>filename</p><p>filename class="directory" (if it end with /)</p></td>
+ <td><p>filename class="directory"</p></td>
+ </tr>
+ <tr>
+ <td><p>tt</p></td>
+ <td><p>literal</p></td>
+ <td>
+ <p>command (this should have been prgn but many documents do this)</p>
+ <p>constant</p>
+ <p>computeroutput</p>
+ <p>envar</p>
+ <p>function</p>
+ <p>keycap</p>
+ <p>keycode</p>
+ <p>keycombo</p>
+ <p>keysym</p>
+ <p>markup</p>
+ <p>option</p>
+ <p>parameter</p>
+ <p>prompt</p>
+ <p>property</p>
+ <p>returnvalue</p>
+ <p>sgmltag</p>
+ <p>symbol</p>
+ <p>token</p>
+ <p>userinput</p>
+ <p>varname</p>
+ <p>wordasword</p>
+ <p>(do we need all these? are all in docbook-simple?</p>
+ </tr>
+ <tr>
+ <td><p>qref</p></td>
+ <td><p>link</p></td>
+ <td><p>citation ?</p></td>
+ </tr>
+ <tr>
+ <td><p>ref</p></td>
+ <td>
+ <p>xref (empty element)</p>
+ </td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>manref</p></td>
+ <td><p>citerefentry + refentrytitle + manvolnum</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>ftpsite (old)</p></td>
+ <td><p>(convert original tag to url in debiandoc source)</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>ftppath (old)</p></td>
+ <td><p>(convert original tag to url in debiandoc source)</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>httpsite (old)</p></td>
+ <td><p>(convert original tag to url in debiandoc source)</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>httppath (old)</p></td>
+ <td><p>(convert original tag to url in debiandoc source)</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>url</p></td>
+ <td><p>ulink</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>footnote</p></td>
+ <td><p>footnote</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>list</p></td>
+ <td><p>itemizedlist</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>list compact</p></td>
+ <td><p>itemizedlist spacing="compact"</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>enumlist</p></td>
+ <td><p>orderedlist</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>enumlist compact</p></td>
+ <td><p>orderedlist spacing="compact"</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>taglist</p></td>
+ <td><p>variablelist</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>taglist compact</p></td>
+ <td><p>variablelist (there is no "spacing" attribute)</p></td>
+ <td><p>(possibly converting to table)</p></td>
+ </tr>
+ <tr>
+ <td><p>item</p></td>
+ <td><p>listitem + para</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>tag</p></td>
+ <td><p>varlistentry + term</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>example</p></td>
+ <td><p>screen</p></td>
+ <td>
+ <p>literallayout class="monospaced"</p>
+ <p></p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>heading</p></td>
+ <td><p>title</p></td>
+ <td><p></p></td>
+ </tr>
+ <tr>
+ <td><p>comment</p></td>
+ <td><p>remark</p></td>
+ <td>
+ <p>caution</p>
+ <p>tip</p>
+ <p>warning</p>
+ <p>note</p>
+ </td>
+ </tr>
+ <tr>
+ <td><p>comment/p</p></td>
+ <td><p>phrase</p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td><p>*HTML* (table)</p></td>
+ <td><p></p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td><p>*HTML* (tr)</p></td>
+ <td><p></p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td><p>*HTML* (th)</p></td>
+ <td><p></p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td><p>*HTML* (td)</p></td>
+ <td><p></p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td><p>*HTML* (img src)</p></td>
+ <td><p></p></td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td><p>?</p></td>
+ <td><p></p></td>
+ <td><p></p></td>
+ </tr>
+
+</table>
+
+<p>
+Here <strong>*HTML*</strong> entries above is not real tags in
+debiandoc-sgml but tags of the missing feature to create
+corresponding HTML tags.
+</p>
+
+<p>
+file splitting is has funny bug which create titletoc.xml in scripts
+directory. Also, multi file XML requires entries like:
+<pre>
+<!ENTITY titletoc SYSTEM "en/titletoc.sgml">
+</pre>
+Currently, this is manual process.
+</p>
+
+</body>
+</html>
Added: packages/debiandoc2dbxml/debian/README
===================================================================
--- packages/debiandoc2dbxml/debian/README 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/README 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,44 @@
+The Debian Package debiandoc2dbxml
+----------------------------------
+
+The script "debiandoc2dbxml" translates a sgml file written according
+to the debiandoc dtd to an xml file following the docbook-xml dtd
+(docbook/dtd/xml/4.2/docbookx.dtd)
+
+You need sgml2xml, part of package sp, and xsltproc, which is now a
+package in itself.
+
+The files are:
+debiandoc-tidy
+debiandoc2dbxml
+debiandoc-xml.dtd
+book.xml
+split.xml
+dd2xml.html
+catalog
+README (this file).
+
+How to use these scripts ?
+
+You must first "normalize" the main sgml file and every file that it loads
+(but not sgml files referenced by entities); you can do:
+debiandoc-tidy [options] file.sgml
+The main option, -e, sets the coding system if needed.
+
+Then you can choose the book element with the -b option
+or the article element with the -a option.
+When the main sgml file declares an internal subset of the dtd, you must
+use the -s option on the command line:
+"debiandoc2dbxml -b -s file.sgml" gives you "file.xml" that you can
+print with jade and jadetex.
+
+When you choose the -S option, the script creates "main.xml" and
+xml files from each bookinfo, chapter and appendix.
+
+Some human polishing remains to be done to get a correctly printed text.
+
+See /usr/share/doc/debiandoc2dbxml/dd2xml.html.
+See the manpages debiandoc2dbxml (1) and debiandoc-tidy (1).
+
+Philippe Batailler
+<philippe.batailler at free.fr>, Mon, 7 Apr 2003 00:45:56 +0200
Added: packages/debiandoc2dbxml/debian/changelog
===================================================================
--- packages/debiandoc2dbxml/debian/changelog 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/changelog 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,15 @@
+debiandoc2dbxml (0.2) unstable; urgency=low
+
+ * Handles an empty <legalnotice> element (closes: #331371)
+ * Corrects a typo in README
+
+ -- Philippe Batailler <philippe.batailler at free.fr> Sat, 8 Oct 2005 10:47:26 +0200
+
+debiandoc2dbxml (0.1) unstable; urgency=low
+
+ * Initial Release.
+ * Package sponsored by Adam Di Carlo (to blame for delays in uploading/review)
+
+ -- Philippe Batailler <philippe.batailler at free.fr> Fri, 20 Jun 2003 20:51:14 -0400
+
+
Added: packages/debiandoc2dbxml/debian/control
===================================================================
--- packages/debiandoc2dbxml/debian/control 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/control 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,20 @@
+Source: debiandoc2dbxml
+Section: text
+Priority: extra
+Maintainer: Philippe Batailler <philippe.batailler at free.fr>
+Uploaders: Adam Di Carlo <aph at debian.org>
+Build-Depends-Indep: debhelper (>> 3.0.0), docbook-utils
+Standards-Version: 3.6.2.1
+
+Package: debiandoc2dbxml
+Architecture: all
+Depends: sgml-base, sgml-data, sp, xsltproc
+Suggests: docbook-xml, debiandoc-sgml
+Description: DebianDoc to DocBook XML converter
+ This package provides a method for converting an SGML file written
+ according to the DebianDoc DTD into an XML file following the DocBook
+ XML DTD.
+ .
+ See the 'docbook-xml' and 'debiandoc-sgml' packages for information
+ about those respective documentation formats.
+
Added: packages/debiandoc2dbxml/debian/copyright
===================================================================
--- packages/debiandoc2dbxml/debian/copyright 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/copyright 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,22 @@
+This is debiandoc2dbxml, maintained by Philippe Batailler
+<philippe.batailler at free.fr>
+on Mon, 7 Apr 2003 00:45:56 +0200.
+
+Copyright (C) 2002 Philippe Batailler
+Copyright (C) 2002 Osamu Aoki <osamu at debian.org>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License with
+ the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL;
+ if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA
+
Added: packages/debiandoc2dbxml/debian/postinst
===================================================================
--- packages/debiandoc2dbxml/debian/postinst 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/postinst 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,27 @@
+#! /bin/sh
+# postinst script for debiandoc2dbxml
+#
+# see: dh_installdeb(1)
+
+set -e
+
+## ----------------------------------------------------------------------
+## Install SGML catalog entries
+PACKAGE=debiandoc2dbxml
+CENTRALCAT=/etc/sgml/debiandoc-xml.cat
+ORDCAT="${PACKAGE}/catalog"
+if [ "$1" = "configure" ]
+then
+ update-catalog --quiet --add ${CENTRALCAT} /usr/share/sgml/${ORDCAT}
+
+ update-catalog --quiet --add --super ${CENTRALCAT}
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
Added: packages/debiandoc2dbxml/debian/postrm
===================================================================
--- packages/debiandoc2dbxml/debian/postrm 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/postrm 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,22 @@
+#! /bin/sh
+# postrm script for debiandoc2dbxml
+#
+# see: dh_installdeb(1)
+
+set -e
+
+## ----------------------------------------------------------------------
+## Remove SGML catalog entries
+
+CENTRALCAT=/etc/sgml/debiandoc-xml.cat
+if [ "$1" = "purge" ]
+then
+ rm -f ${CENTRALCAT} ${CENTRALCAT}.old
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
Added: packages/debiandoc2dbxml/debian/prerm
===================================================================
--- packages/debiandoc2dbxml/debian/prerm 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/prerm 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,24 @@
+#! /bin/sh
+# prerm script for debiandoc2dbxml
+#
+# see: dh_installdeb(1)
+
+set -e
+
+## ----------------------------------------------------------------------
+## Remove SGML catalog entries
+
+CENTRALCAT=/etc/sgml/debiandoc-xml.cat
+if [ "$1" = "remove" -o "$1" = "upgrade" ]
+then
+ update-catalog --quiet --remove --super ${CENTRALCAT}
+fi
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
+
+
Added: packages/debiandoc2dbxml/debian/rules
===================================================================
--- packages/debiandoc2dbxml/debian/rules 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debian/rules 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,77 @@
+#!/usr/bin/make -f
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# This is the debhelper compatibility version to use.
+export DH_COMPAT=3
+
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+
+ touch configure-stamp
+
+
+build: build-stamp
+
+build-stamp: configure-stamp
+ dh_testdir
+ $(MAKE)
+ touch build-stamp
+
+clean:
+ dh_testdir
+ rm -f build-stamp configure-stamp
+
+ -$(MAKE) clean
+
+ dh_clean
+
+install: build
+ dh_testdir
+ dh_testroot
+ dh_clean -k
+ dh_installdirs
+
+ $(MAKE) DESTDIR=$(CURDIR)/debian/debiandoc2dbxml install
+
+# Build architecture-independent files here.
+binary-indep: build install
+
+ dh_testdir
+ dh_testroot
+# dh_installdebconf
+ dh_installdocs debian/README
+# dh_installexamples
+# dh_installmenu
+# dh_installlogrotate
+# dh_installemacsen
+# dh_installpam
+# dh_installmime
+# dh_installinit
+# dh_installcron
+ dh_installman
+# dh_installinfo
+# dh_undocumented
+ dh_installchangelogs
+# dh_link
+# dh_strip
+ dh_compress
+ dh_fixperms
+# dh_makeshlibs
+ dh_installdeb
+# dh_perl
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+
+# Build architecture-dependent files here.
+binary-arch: build install
+# We have nothing to do by default.
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install configure
Property changes on: packages/debiandoc2dbxml/debian/rules
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/debiandoc2dbxml/debiandoc-tidy
===================================================================
--- packages/debiandoc2dbxml/debiandoc-tidy 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debiandoc-tidy 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,148 @@
+#!/bin/sh -e
+
+# debiandoc-normalize - normalize debiandoc sgml file
+#
+# Copyright (C) 2002 Philippe Batailler <pbatailler at teaser.fr>
+# Copyright (C) 2002 Osamu Aoki <osamu at aokiconsulting.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+progname=${0##*/}
+
+version=0.6
+
+dummypercent="DuMmyPerCeNtIZheReDuMmY"
+
+# [ ] are '[' and 'space' and 'tab' and ']'
+# sed regex does not have +
+
+##----------------------------------------------------------------
+## get command line options
+
+opt_h=false
+opt_k=false
+opt_e=false
+
+infile=
+encoding=
+encoding0="iso-8859-1"
+
+for opt ; do
+ case $opt in
+ -e | --encoding ) opt_e=true ;;
+ -h | --help ) opt_h=true ;;
+ -v | --version ) { echo "$progname: version "$version; exit 0;} ;;
+ -t | --trace ) set -x ;;
+ -k | --keep ) opt_k=true ;;
+ -* ) { echo "$progname:error: invalid command-line option: $opt
+Try \`$progname --help' for more information." >&2; exit 1; } ;;
+ * )
+ if test -n "$encoding"; then
+ { echo "$progname:error: too many arguments.
+Try \`$progname --help' for more information." >&2; exit 1; }
+ fi
+ if test -z "$infile"; then
+ infile=$opt
+ else
+ encoding=$opt
+ fi
+ ;;
+ esac
+done
+
+
+##------------------------------------------------------------
+## Display help message
+
+if $opt_h; then
+ cat <<END
+$progname version $version
+
+Usage: $progname [options] filename [encoding]
+Options: -h print this help message
+ -e set encoding for <?xml ... , default $encoding0
+ -k keep intermediate files
+ -t trace
+ -v version number
+Description:
+ Prepare SGML file for the conversion to XML
+ Fix % related syntax and capitalize reserved words
+
+ Copyright (C) 2002 Philippe Batailler <pbatailler at teaser.fr>
+ Copyright (C) 2002 Osamu Aoki <osamu at aokiconsulting.com>
+END
+ exit 0
+fi
+
+if test -z "$infile"; then
+ echo "$progname:error: too few arguments.
+Try \`$progname --help' for more information." >&2
+ exit 1
+fi
+
+if test -z "$encoding"; then
+ encoding=$encoding0
+fi
+
+##-----------------------------------------------------------------
+$opt_k || trap "rm -f ${infile}.mod? >/dev/null 2>&1; exit 1" 1 2 15
+
+##-----------------------------------------------------------------
+# Keep original
+mv -f $infile $infile.mod0
+
+# Upper case for reserved words, no tab but space
+sed \
+ -e 's/^[ ]*<!doctype[ ]/<!DOCTYPE /' \
+ -e 's/^[ ]*<!\(.*\)public[ ]/<!\1 PUBLIC /' \
+ -e 's/^[ ]*<![ ]*system[ ]/<! SYSTEM /' \
+ -e 's/^[ ]*<!\(.*\)[ ]system[ ]/<!\1 SYSTEM /' \
+ -e 's/^[ ]*<!entity[ ]/<!ENTITY /g' \
+ -e 's/^[ ]*<\(.*\)[ ]entity[ ]/<\1 ENTITY /g' \
+ <$infile.mod0 >$infile.mod1
+
+# Normalize sgml for external reference and protect %
+sed -e 's/<!\[[ ]*%\([^ ][^ ;]*\);*[ ]*/<!\[ '$dummypercent'\1; /g' \
+ -e 's/<!ENTITY[ ][ ]*%[ ][ ]*/<!ENTITY '$dummypercent' /g' \
+ < $infile.mod1 >$infile.mod2
+
+# replace % with ASCII 37 code description to avoid problem.
+# But do not do that in the header <!DOCTYPE .... ]>
+# End of header should be 1 line only containing ]>
+sed -n \
+ -e '/^<!DOCTYPE/,/]>$/!{s/%/\%/g;p;}' \
+ -e '/^<!DOCTYPE/,/]>$/p' \
+ <$infile.mod2 >$infile.mod3
+
+# recover % where needed
+sed -e 's/'$dummypercent'/%/g' <$infile.mod3 >$infile.mod4
+
+# insert encoding
+## do not add encoding in .sgml files, only in .ent files.
+
+if $opt_e ## Do we add encoding ?
+then
+ sed -e '/<?xml version="1.0" encoding="/d' $infile.mod4 |\
+ sed -e '1i\
+<?xml version="1.0" encoding="'$encoding'"?>' >$infile
+else
+ cp $infile.mod4 $infile
+fi
+##--------------------------------------------------------------
+## removing intermediate files
+
+$opt_k || rm -f $infile.mod?
Property changes on: packages/debiandoc2dbxml/debiandoc-tidy
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/debiandoc2dbxml/debiandoc-tidy.1.sgml
===================================================================
--- packages/debiandoc2dbxml/debiandoc-tidy.1.sgml 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debiandoc-tidy.1.sgml 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,90 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
+<refentry>
+ <refmeta>
+ <refentrytitle>debiandoc-tidy</>
+ <manvolnum>1</>
+ </refmeta>
+
+ <!-- Man page title -->
+ <refnamediv>
+ <refname>debiandoc-tidy</>
+ <refpurpose>Script to "normalize" debiandoc-sgml files</>
+ </refnamediv>
+
+ <!-- Arguments -->
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>debiandoc-tidy</>
+ <arg><option>-hvke</option></arg>
+ <arg><replaceable>file</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <RefSect1><Title>Description</>
+ <para>
+ <command>debiandoc-tidy</command> prepares SGML files for the conversion
+to XML. It capitalizes reserved sgml words and normalises entity references.
+It can add an encoding attribute to the xml declaration in ".ent" files.
+ </para>
+<para>This script is related to and must be run before
+<command>debiandoc2dbxml</command>.
+ </para>
+ </RefSect1>
+
+ <RefSect1><Title>Options</>
+ <para>
+
+ <VariableList>
+ <VarListEntry><term><option>-h</option></term>
+ <ListItem><Para>
+ Print a help message.</para>
+ </listitem>
+ </VarListEntry>
+
+
+ <VarListEntry><term><option>-v</option></term>
+ <ListItem><Para>
+ Print the version number.</para>
+ </listitem>
+ </VarListEntry>
+
+
+ <VarListEntry><term><option>-k</option></term>
+ <ListItem><Para>
+Keep intermediate files for debugging.</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-e</option></term>
+ <ListItem><Para>
+Set the encoding in xml declaration. If you have a main sgml file that
+calls ".ent" files, you may add a ligne
+"<?xml version="1.0" encoding="'$encoding'"?>"
+in front of these files.
+</para>
+ </listitem>
+ </VarListEntry>
+</VariableList>
+ </para>
+ </RefSect1>
+
+ <RefSect1><Title>See Also</>
+ <para>
+/usr/share/doc/debiandoc2dbxml/dd2xml.html.
+ </para>
+<para>
+ <CiteRefEntry>
+ <RefEntryTitle><command>debiandoc2dbxml</command></RefEntryTitle>
+ <ManVolNum/1/
+ </CiteRefEntry>
+ </para>
+ </RefSect1>
+
+<RefSect1><Title>Author</>
+ <para>
+This page was written by Philippe Batailler
+<email>philippe.batailler at free.fr</email>.
+April 2003.</para>
+ </RefSect1>
+
+</refentry>
Added: packages/debiandoc2dbxml/debiandoc-xml.dtd
===================================================================
--- packages/debiandoc2dbxml/debiandoc-xml.dtd 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debiandoc-xml.dtd 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,104 @@
+<!--
+This file is part of Debiandoc2dbxml.
+debiandoc-xml.dtd: this is an xml version of the debiandoc sgml dtd
+which is included in the debiandoc-sgml package (version 1.1.78).
+
+-->
+<!ENTITY urlname "">
+<!ENTITY % dbcent.module "INCLUDE">
+<![%dbcent.module;[
+<!ENTITY % dbcent PUBLIC
+"-//Norman Walsh//ENTITIES DocBk XML Character Entities V4.0//EN"
+"/usr/share/sgml/docbook/dtd/xml/4.0/dbcentx.mod">
+%dbcent;
+]]>
+
+<!ENTITY % xref "ref|manref|email|ftpsite|ftppath|httpsite|httppath|url">
+<!ENTITY % emph "em|strong|var|package|prgn|file|tt|qref">
+<!ENTITY % list "list|enumlist|taglist">
+<!ENTITY % inline "%emph;|%xref;|footnote|comment">
+<!ENTITY % inpara "%inline;|%list;|example|include">
+<!ENTITY % paras "(p+)">
+<!ENTITY % sect "heading,(%paras;)?">
+
+<!ELEMENT debiandoc-xml (book)>
+<!ELEMENT book (titlepag,toc?,chapt+,appendix*)>
+<!ATTLIST book id CDATA #IMPLIED>
+
+<!ELEMENT titlepag (title,author+,translator*,version?,abstract?,copyright?)>
+<!ELEMENT title (#PCDATA | %inline;)*>
+<!ELEMENT author (name,email?)>
+<!ELEMENT translator (name,email?)>
+<!ELEMENT name (#PCDATA | %inline;)*>
+<!ELEMENT version (#PCDATA|date)*>
+<!ELEMENT date EMPTY>
+<!ELEMENT abstract (#PCDATA | %inpara;)*>
+<!ELEMENT copyright (copyrightsummary+,p*)>
+<!ELEMENT copyrightsummary (#PCDATA | %inpara;)*>
+
+<!ELEMENT toc EMPTY>
+<!ATTLIST toc detail (chapt|sect|sect1|sect2) "sect">
+
+<!ELEMENT chapt ((%sect;),sect*)>
+<!ATTLIST chapt id CDATA #IMPLIED>
+<!ELEMENT appendix ((%sect;),sect*)>
+<!ATTLIST appendix id CDATA #IMPLIED>
+<!ELEMENT sect ((%sect;),sect1*)>
+<!ATTLIST sect id CDATA #IMPLIED>
+<!ELEMENT sect1 ((%sect;),sect2*)>
+<!ATTLIST sect1 id CDATA #IMPLIED>
+<!ELEMENT sect2 ((%sect;),sect3*)>
+<!ATTLIST sect2 id CDATA #IMPLIED>
+<!ELEMENT sect3 ((%sect;),sect4*)>
+<!ATTLIST sect3 id CDATA #IMPLIED>
+<!ELEMENT sect4 (%sect;)>
+<!ATTLIST sect4 id CDATA #IMPLIED>
+
+<!ELEMENT heading (#PCDATA | %inline;)* >
+<!ELEMENT p (#PCDATA | %inpara;)*>
+
+<!ELEMENT example (#PCDATA | %inline;)*>
+<!ATTLIST example compact (compact) #IMPLIED>
+<!ELEMENT include EMPTY>
+<!ATTLIST include source CDATA #REQUIRED
+ language (text) "text"
+ compact (compact) #IMPLIED>
+
+<!ELEMENT footnote (%paras;)>
+<!ELEMENT comment (%paras;)>
+<!ATTLIST comment editor CDATA "">
+
+<!ELEMENT list (item+)>
+<!ATTLIST list compact (compact) #IMPLIED>
+<!ELEMENT enumlist (item+)>
+<!ATTLIST enumlist compact (compact) #IMPLIED
+ continue (continue) #IMPLIED
+ numeration (arabic|upperalpha|loweralpha|upperroman|lowerroman) "arabic">
+<!ELEMENT taglist (tag+,item)+>
+<!ATTLIST taglist compact (compact) #IMPLIED>
+<!ELEMENT tag (#PCDATA | %inline;)*>
+<!ELEMENT item (%paras;)>
+
+<!ELEMENT em (#PCDATA | %inline;)*>
+<!ELEMENT strong (#PCDATA | %inline;)*>
+<!ELEMENT var (#PCDATA | %inline;)*>
+<!ELEMENT package (#PCDATA | %inline;)*>
+<!ELEMENT prgn (#PCDATA | %inline;)*>
+<!ELEMENT file (#PCDATA | %inline;)*>
+<!ELEMENT tt (#PCDATA | %inline;)*>
+<!ELEMENT qref (#PCDATA | %inline;)*>
+<!ATTLIST qref id CDATA #REQUIRED>
+
+<!ELEMENT ref EMPTY>
+<!ATTLIST ref id CDATA #REQUIRED>
+<!ELEMENT manref EMPTY>
+<!ATTLIST manref name CDATA #REQUIRED
+ section CDATA #REQUIRED>
+<!ELEMENT email (#PCDATA)>
+<!ELEMENT ftpsite (#PCDATA)>
+<!ELEMENT ftppath (#PCDATA)>
+<!ELEMENT httpsite (#PCDATA)>
+<!ELEMENT httppath (#PCDATA)>
+<!ELEMENT url EMPTY>
+<!ATTLIST url id CDATA #REQUIRED
+ name CDATA "&urlname;">
Added: packages/debiandoc2dbxml/debiandoc2dbxml
===================================================================
--- packages/debiandoc2dbxml/debiandoc2dbxml 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debiandoc2dbxml 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,220 @@
+#!/bin/bash
+
+# debiandoc2dbxml - translate debiandoc sgml file into
+# docbook-xml file.
+# Copyright (C) 2002 2003 Philippe Batailler <philippe.batailler at free.fr>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or (at
+# your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+progname=${0##*/}
+
+version=0.96
+
+BIN="/usr/bin"
+LIB="/usr/share/sgml/debiandoc2dbxml"
+
+# package xsltproc
+#
+xsltcmd=$BIN/xsltproc
+
+## ----------------------------------------------------------------------
+## print error message
+function usage_error
+{
+ echo >&2 "${progname}: ${@}";
+ exit 2;
+}
+
+##----------------------------------------------------------------
+## get command line options
+#
+opt_a=false
+opt_b=false
+opt_h=false
+opt_k=false
+opt_s=false
+opt_S=false
+type=book
+locale=
+infile=
+
+while getopts ":abhvtkl:sS" opt
+do
+ case $opt in
+ a ) type="article" ;;
+ b ) type="book" ;;
+ h ) opt_h=true ;;
+ v ) { echo "$progname: version "$version; exit 0;} ;;
+ t ) set -x ;;
+ k ) opt_k=true ;;
+ l ) locale="${OPTARG}" ;;
+ s ) opt_s=true ;;
+ S ) opt_S=true ;;
+ \? ) usage_error "unknown option \`${OPTARG}'"
+ esac
+done
+shift $((${OPTIND} - 1))
+
+## ----------------------------------------------------------------------
+## check remaining command line options
+[ ${#} = 1 ] || usage_error "need exactly one input filename"
+
+## ----------------------------------------------------------------------
+## get input file name
+infile="${1}"
+
+## ----------------------------------------------------------------------
+# set default locale
+if [ -z "$locale" ];
+then
+locale=en
+fi
+
+##------------------------------------------------------------
+## Display help message
+#
+if $opt_h; then
+ cat <<END
+$progname version $version
+
+Usage: $progname [options] filename
+Options: -h print this help message
+ -k keep intermediate files
+ -s subset of the dtd
+ -t set trace
+ -v version number
+ -a article format
+ -b book format
+ -S splitting the result in many files
+ -l locale (fr, en, es...)
+END
+ exit 0
+fi
+
+##-----------------------------------------------------------------
+## temporary filenames
+#
+basename=${infile%.sgml}
+headerfile=$basename.head
+outfile=$basename.xml
+outfile_int=main.$locale.xml
+
+##-----------------------------------------------------------------
+## Declarations
+#
+
+xml_declaration='<?xml version="1.0" encoding="iso-8859-1"?>'
+
+XMLdtd_declaration='<!DOCTYPE '$type' PUBLIC "-//Norman Walsh//DTD DocBk XML V4.2//EN" "/usr/share/sgml/docbook/dtd/xml/4.2/docbookx.dtd"'
+
+dtd_declaration='<!DOCTYPE debiandoc-xml PUBLIC "-//DebianDoc//DTD DebianDocXml//EN" "/usr/share/sgml/debiandoc2dbxml/debiandoc-xml.dtd"'
+
+
+##-----------------------------------------------------------------
+#
+$opt_k || trap "rm -f $basename.head sgml.error xml.error $source_dir/main1.xml>/dev/null 2>&1; exit 1" 1 2 15
+
+##-----------------------------------------------------------------
+## Where are we ?
+#
+source_dir=${1%/*}
+dir=$(pwd)
+if [ -f $source_dir ]
+ then
+ source_dir=$dir
+fi
+
+##-----------------------------------------------------------------
+## get the prolog of the document, change it, append xml declaration and
+## create a new prolog
+## Usually, debiandoc files start with a line like this :
+## <!DOCTYPE debiandoc SYSTEM>. We must add a system identifier.
+
+
+echo $xml_declaration > $headerfile
+echo $xml_declaration > $outfile
+
+if $opt_s ## Is there any subset?
+
+then
+ echo $dtd_declaration >> $headerfile
+ sed -n '/^<!DOCTYPE /,/<debiandoc>$/p' $infile | \
+ sed -e 's/<!DOCTYPE .* \[/\[/' -e '$d' >> $headerfile
+ echo $XMLdtd_declaration >> $outfile
+ sed -n '/^<!DOCTYPE /,/<debiandoc>$/p' $infile | \
+ sed -e 's/<!DOCTYPE .* \[/\[/' -e '$d' >> $outfile
+ cat $outfile > $outfile_int
+
+else
+ echo $dtd_declaration >> $headerfile
+ sed -n 's/<!DOCTYPE .*>/>/p' $infile >> $headerfile
+ echo $XMLdtd_declaration'>' >> $outfile
+ cat $outfile > $outfile_int
+
+fi
+
+
+##----------------------------------------------------------------
+## generating the file that follows the new dtd
+
+ echo "====== sgml2xml ======="
+
+$BIN/sgml2xml -b iso-8859-1 -x empty -x lower -x comment -x no-nl-in-tag -x cdata $infile 2>$source_dir/sgml.error | sed -e 1d -e "s/debiandoc/debiandoc-xml/g" >> $headerfile
+
+
+##----------------------------------------------------------------
+## generating the xml file
+
+ echo "------ xslt --------"
+
+ xslt_format=$LIB/book.xml
+
+ $xsltcmd --stringparam style $type $xslt_format $headerfile >> $outfile 2>$source_dir/xml.error
+
+
+##--------------------------------------------------------------
+## Creating xml files from the bookinfo (titletoc) and from each chapter
+## and appendix. ( if the -S or --split option is chosen)
+
+ if $opt_S
+ then
+ mkdir $source_dir/$locale
+ split=$LIB/split.xml
+ $xsltcmd --stringparam locale $locale --stringparam dir $source_dir/$locale -o $source_dir/main1.xml $split $outfile
+ cat $source_dir/main1.xml >> $outfile_int
+ rm -f $outfile
+ else
+ rm -f $outfile_int
+ fi
+
+##--------------------------------------------------------------
+## If xml.error is not empty, there is a problem !!
+## we shoud error out.
+
+ if [ -s $source_dir/xml.error ];
+ then
+ echo "Some errors occured! Please read '$source_dir/xml.error'
+for more information"
+ else
+ rm -f $source_dir/xml.error
+ fi
+
+
+##--------------------------------------------------------------
+## removing intermediate files
+
+$opt_k || rm -f $basename.head sgml.error $source_dir/main1.xml
Property changes on: packages/debiandoc2dbxml/debiandoc2dbxml
___________________________________________________________________
Name: svn:executable
+ *
Added: packages/debiandoc2dbxml/debiandoc2dbxml.1.sgml
===================================================================
--- packages/debiandoc2dbxml/debiandoc2dbxml.1.sgml 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/debiandoc2dbxml.1.sgml 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,116 @@
+<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V3.1//EN">
+<refentry>
+ <refmeta>
+ <refentrytitle>debiandoc2dbxml</>
+ <manvolnum>1</>
+ </refmeta>
+
+ <!-- Man page title -->
+ <refnamediv>
+ <refname>debiandoc2dbxml</>
+ <refpurpose>Utility to translate debiandoc-sgml files into docbookxml files</>
+ </refnamediv>
+
+ <!-- Arguments -->
+ <refsynopsisdiv>
+ <cmdsynopsis>
+ <command>debiandoc2dbxml</>
+ <arg><option>-hvabsSk</option></arg>
+ <arg><option>-l <replaceable>locale string</replaceable></option></arg>
+ <arg><replaceable>file</replaceable></arg>
+ </cmdsynopsis>
+ </refsynopsisdiv>
+
+ <RefSect1><Title>Description</>
+ <para>
+ <command>debiandoc2dbxml</command> will take a debiandoc-sgml file and
+convert it into a docbook xml file. The root element can be "book" or
+"article". The version of docbookx.dtd is 4.0.
+ </para>
+<para>
+Before using <command>debiandoc2dbxml</command>, you should run
+<command>debiandoc-tidy</command> in order to "normalize" your sgml file.
+ </para>
+ </RefSect1>
+
+ <RefSect1><Title>Options</>
+ <para>
+
+ <VariableList>
+ <VarListEntry><term><option>-h</option></term>
+ <ListItem><Para>
+ Print a help message.</para>
+ </listitem>
+ </VarListEntry>
+
+
+ <VarListEntry><term><option>-v</option></term>
+ <ListItem><Para>
+ Print the version number.</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-a</option></term>
+ <ListItem><Para>
+ Choose the root element "article".</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-b</option></term>
+ <ListItem><Para>
+ Choose the root element "book".</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-s</option></term>
+ <ListItem><Para>
+Indicate that there is a subset of the dtd in the prolog of the sgml file.</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-S</option></term>
+ <ListItem><Para>
+Choose to split the result in many files. The script creates "main.xml" and
+xml files from each bookinfo, chapter and appendix. This option should be
+used with the -l option.</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-l</option></term>
+ <ListItem><Para>
+A string that indicates where you want to put the xml files when the -S option
+has been chosen. The "main.xml" goes to path/to/ and the xml files go to
+path/to/string/.</para>
+ </listitem>
+ </VarListEntry>
+
+ <VarListEntry><term><option>-k</option></term>
+ <ListItem><Para>
+The script creates two files "sgml.error" and "xml.error" which you can
+read when this option has been set.</para>
+ </listitem>
+ </VarListEntry>
+ </VariableList>
+ </para>
+ </RefSect1>
+
+ <RefSect1><Title>See Also</>
+ <para>
+/usr/share/doc/debiandoc2dbxml/dd2xml.html.
+ </para>
+<para>
+ <CiteRefEntry>
+ <RefEntryTitle><command>debiandoc-tidy</command></RefEntryTitle>
+ <ManVolNum/1/
+ </CiteRefEntry>
+ </para>
+ </RefSect1>
+
+<RefSect1><Title>Author</>
+ <para>
+This page was written by Philippe Batailler
+<email>philippe.batailler at free.fr</email>.
+April 2003.</para>
+ </RefSect1>
+
+</refentry>
Added: packages/debiandoc2dbxml/split.xml
===================================================================
--- packages/debiandoc2dbxml/split.xml 2005-09-13 17:29:58 UTC (rev 479)
+++ packages/debiandoc2dbxml/split.xml 2005-10-10 19:12:14 UTC (rev 480)
@@ -0,0 +1,80 @@
+<!--
+This file is part of Debiandoc2docbookxml
+split.xml
+-->
+<xsl:stylesheet version="1.0"
+xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<xsl:output
+version="1.0"
+method="xml"
+indent="yes"
+omit-xml-declaration="yes"
+encoding="iso-8859-1"/>
+
+<xsl:template match="chapter" priority="+1">
+<xsl:variable name="chap">
+<xsl:value-of select="@id"/>
+</xsl:variable>
+<xsl:document href="{$dir}/{$chap}.{$locale}.xml" method="xml" omit-xml-declaration="yes" indent="yes" encoding="iso-8859-1">
+<chapter>
+<xsl:if test="@id!=''">
+<xsl:attribute name="id">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+</xsl:if>
+<xsl:apply-templates/>
+</chapter>
+</xsl:document>
+<xsl:text disable-output-escaping="yes">&</xsl:text><xsl:value-of select="$chap"/><xsl:text>; </xsl:text>
+</xsl:template>
+
+<xsl:template match="appendix" priority="+1">
+<xsl:variable name="chap">
+<xsl:value-of select="@id"/>
+</xsl:variable>
+<xsl:document href="{$dir}/{$chap}.{$locale}.xml" method="xml" omit-xml-declaration="yes" indent="yes" encoding="iso-8859-1">
+<appendix>
+<xsl:if test="@id!=''">
+<xsl:attribute name="id">
+<xsl:value-of select="@id"/>
+</xsl:attribute>
+</xsl:if>
+<xsl:apply-templates/>
+</appendix>
+</xsl:document>
+<xsl:text disable-output-escaping="yes">&</xsl:text><xsl:value-of select="$chap"/><xsl:text>; </xsl:text>
+</xsl:template>
+
+<xsl:template match="bookinfo" priority="+1">
+<xsl:document href="{$dir}/titletoc.{$locale}.xml" method="xml" omit-xml-declaration="yes" indent="yes" encoding="iso-8859-1">
+<bookinfo>
+<xsl:apply-templates/>
+</bookinfo>
+</xsl:document>
+<xsl:text disable-output-escaping="yes">&titletoc; </xsl:text>
+</xsl:template>
+
+<xsl:template match="@*|node()">
+<xsl:copy>
+<xsl:apply-templates select="@*|node()"/>
+</xsl:copy>
+</xsl:template>
+
+<xsl:template match="comment()">
+<xsl:comment>
+<xsl:value-of select="."/>
+</xsl:comment>
+</xsl:template>
+
+<xsl:template match="processing-instruction()">
+<xsl:copy>
+<xsl:value-of select="."/>
+</xsl:copy>
+</xsl:template>
+
+<xsl:template match="text()">
+<xsl:value-of select="."/>
+</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file
More information about the debian-xml-sgml-commit
mailing list