HTML to DocBook translation

Subject: HTML to DocBook translation
From: Alexander Taranov <tay@xxxxxxxxxx>
Date: Thu, 5 Feb 1998 16:38:23 +0300 (MSK)
Christian Leutloff writes:
 > Hello,
 > 
 > I want to translate some HTML documents into the DocBook format. I've
 > started with the following dsl:
 > 
 > <-------------------------
 > <!doctype style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">
 > 
 > (declare-flow-object-class element
 >   "UNREGISTERED::James Clark//Flow Object Class::element")
 > 
 > (define (copy-attributes #!optional (nd (current-node)))
 >   (let loop ((atts (named-node-list-names (attributes nd))))
 >     (if (null? atts)
 >         '()
 >         (let* ((name (car atts))
 >                (value (attribute-string name nd)))
 >           (if value
 >               (cons (list name value)
 >                     (loop (cdr atts)))
 >               (loop (cdr atts)))))))
 > 
 > (default 
 >   (let* ((old-gi (gi (current-node)))
 > 	 (new-gi
 > 	  (case old-gi
 > 	    (("H1") "sect2")
 > 	    (("H2") "sect3")
 > 	    (("H3") "sect4")
 > 	    (("H4") "sect5")
 > 	    (("LI") "item")
 > 	    (("UL") "itemizedlist")
 > 	    (("I")  "emphasize")
 > 	    (("TT") "command")
 > 	    (("P") "para")
 > 	    (else old-gi))))
 >     (make element
 > 	  gi: new-gi
 > 	  attributes: (copy-attributes))))
 > <--------------------

But this transformation will act so:

<H1> Heading 1</H1>
<p> first para of my html</p>

will become

<sect2>Heading 1</sect2>
<para>first para of my html</para>

which is definitely not what you probably want:

<sect2><title>Heading 1</title>
  <para>first para of my html</para>
</sect2>

Alexander

 > 
 > But how can I translate the <a>-tag?
 > 
 > It is a label and a reference:
 > 
 > <a name="label">labelpos</a>
 > 
 > and
 > 
 > <a href="label">see labelpos</a>
 > 
 > Any ideas?
 > 
 > Has someone a working (it must not be perfect) solution?
 > 
 > 
 > Btw:
 > 
 > Where can I found I very *short* and easy introduction into DSSSL?
 > 
 > Is there a short reference for the DocBook DTD on 2 (or so) pages
 > available?
 > 
 > 
 > Thanks in advance
 >                 Christian
 > 
 > -- 
 > Christian Leutloff, Aachen, Germany         leutloff@xxxxxxxxxxxxxxxxx  
 >       http://www.oche.de/~leutloff/         leutloff@xxxxxxxxxx      
 > 
 >             Debian GNU/Linux - http://www.de.debian.org/
 > 


 DSSSList info and archive:  http://www.mulberrytech.com/dsssl/dssslist


Current Thread
  • HTML to DocBook translation
    • Christian Leutloff - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id PAA12945Wed, 4 Feb 1998 15:01:20 -0500 (EST)
      • Thomas G. Lockhart - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id VAA15068Wed, 4 Feb 1998 21:33:51 -0500 (EST)
      • Norman Walsh - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id IAA24857Thu, 5 Feb 1998 08:15:22 -0500 (EST)
      • Alexander Taranov - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id IAA25195Thu, 5 Feb 1998 08:37:52 -0500 (EST) <=
      • <Possible follow-ups>
      • Marcus Carr - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id RAA28842Thu, 5 Feb 1998 17:14:28 -0500 (EST)