|
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 |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: HTML to DocBook translation, Norman Walsh | Thread | Re: HTML to DocBook translation, Marcus Carr |
| Re: HTML to DocBook translation, Norman Walsh | Date | ANNOUNCE: Modular DocBook Styleshee, Norman Walsh |
| Month |