Re: Modifying SGML tags

Subject: Re: Modifying SGML tags
From: Daniel Speck <dspeck@xxxxxxxxxxxx>
Date: Fri, 23 Jan 1998 13:21:43 -0500
Fabienne.CLAVERIE@xxxxxxxxxxxx wrote:

> Now I meet a new difficulty. I want to transform an instance conforming to
> one DTD to make it use another one. The content of each component of the DTD
> remain unchanged but the name of the tag itself must be different in order to
> correspond to a second DTD. I know that I can modify the presentation of the
> instance using my file.dsl but is it possible to change the names of the tags
> while preserving their contents?

You should take a look at the Jade documentation for the non-standard SGML flow
object classes. James provides an example script that performs an identity
SGML->SGML transformation. All you need to do is modify that example along the
lines of:

...
(default
    (let* ((old-gi (gi (current-node)))
            (new-gi
              (case old-gi
                (("ELEMENT1") "NEWELEMENT1")
                (("ELEMENT2") "NEWELEMENT2")
                ...
                (else old-gi))))
    (make element
      gi: new-gi
      attributes: (copy-attributes))))

-dan

--
Daniel Speck                              e-mail: dspeck@xxxxxxxxxxxx
Research Engineer                          voice:     +1 301.548.7818
Thomson Technology Services Group            fax:     +1 301.527.4094
1375 Piccard Drive, Rockville, MD 20850      WWW:    www.thomtech.com

begin:          vcard
fn:             Daniel Speck
n:              Speck;Daniel
org:            Thomson Technology Services Group
adr:            1375 Piccard Drive;;Suite 250;Rockville;MD;20850;USA
email;internet: dspeck@xxxxxxxxxxxx
title:          Research Engineer
tel;work:       (301) 548-7818
tel;fax:        (301) 527-4094
x-mozilla-cpt:  ;0
x-mozilla-html: TRUE
version:        2.1
end:            vcard

Current Thread
  • Modifying SGML tags
    • Fabienne . CLAVERIE - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id FAA08959Thu, 22 Jan 1998 05:35:24 -0500 (EST)
      • Daniel Speck - from mail1.ability.netby web4.ability.net (8.8.5/8.6.12) with ESMTP id NAA02995Fri, 23 Jan 1998 13:23:53 -0500 (EST) <=