|
Subject: Getting the contents of an element From: Georg Rehm <georg@xxxxxxxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 20 Apr 1998 10:54:03 +0200 (MEST) |
Hi there,
Several regular posters from comp.text.sgml suggested that I should ask
this question on DSSSList. As I subscribed to this list only a couple of
minutes ago the usual disclaimer applies. ;-)
I have a couple (about 900) SGML documents that I want to automatically
convert into HTML documents. The basic structure of the documents is as
follows:
<!DOCTYPE text system "text.dtd">
<TEXT>
<META>
<COPYRIGHT>Copyright [...]</COPYRIGHT>
<TEXTID>T921116.10</TEXTID>
<ZEITUNG>TAZ</ZEITUNG>
[...]
</META>
<PARAGRAPH ID=P1 FKT=H1> <SATZ ID=P1S1 NUM=1>Deutschland,
deine Täter!</SATZ></PARAGRAPH>
[...]
</TEXT>
After marking up the documents (this happens automatically), I feed the
SGML into jade using the "-t sgml" switch and James Clark's proprietary
extensions to transform SGML documents.
What I'm currently trying to do is to insert the contents of the <TEXTID>
tag (a short string like the above, e.g. "T921116.10") into the <TITLE>
tag of the resulting HTML document. Furthermore, <TEXTID> has to be pro-
cessed in another place in my DSSSL script (the latter works just fine).
Oisin McGuinness suggested the following function (get-contents gi) in
an email which he sent to me after my initial posting to comp.text.sgml:
; my top-level gi
(define *top-gi* "TEXT")
; let's do anything with the textid element
(element textid
(make element gi: "U")
)
(define (get-contents gi)
(process-node-list
(node-list-first
(select-elements
(descendants (ancestor *top-gi*)) gi))))
; Top-Level Element
(element text
(make sequence
(make document-type [...]
(make element gi: "HTML"
(make element gi: "HEAD"
(make element gi: "TITLE"
(get-contents "TEXTID")))
(make element gi: "BODY"
[...]
This is a kind of lengthy excerpt from my DSSSL "style sheet". I call
(get-contents gi) in the appropriate place, I think. Furthermore, the
function definition looks really good to me. But, and that is the
problem: _Nothing_ happens inside the <TITLE> tag.
Any help to the solution of this bug is really appreciated,
Greetings,
Georg
--
Georg Rehm georg@xxxxxxxxxxxxxxxxxxxxxxx
Institute for Semantic Information-Processing, University of Osnabrueck, FRG
DSSSList info and archive: http://www.mulberrytech.com/dsssl/dssslist
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Daniel M. German's tutorial: mirror, Georg Rehm | Thread | Re: Getting the contents of an elem, Chris Maden |
| Daniel M. German's tutorial: mirror, Georg Rehm | Date | Re: Sorting like elements, W. Eliot Kimber |
| Month |