RE: JADE--SGML Backend--attributes

Subject: RE: JADE--SGML Backend--attributes
From: Pascal Le-Carrour <pascal.le-carrour@xxxxxxxxxxxxxxxx>
Date: Wed, 24 Mar 1999 17:31:16 +-100
Thanks a lot to Daniel,

Your code works perfectly well provided you give the " current-node " argument to the " data " function.

....
attributes: (list (list "href" (string-append "mailto:"; (data(current-node))))
....

Thanks a lot too to Annegret and Jany for their answers.

Pascal

----------
De:  Daniel Speck[SMTP:dspeck@xxxxxxx]
Date d'envoi:  mercredi 24 mars 1999 15:09
A: dssslist@xxxxxxxxxxxxxxxx
Objet:  Re: JADE--SGML Backend--attributes

Pascal Le-Carrour wrote:

> Is there any smart way to get the content of a tag (of input SGML) in a attributes value (of the output SGML) ?

Yes, there is a function (data) that returns the concatenated data content of an element as a string. You just need
to specify this as the value of the attribute in the (make element ...) rule. For the code you provide below I
would substitute:

(element MY_TAG
...
    (make element
        gi:    "td"
        (make element
            gi: "a"
            attributes: (list (list "href" (string-append "mailto:"; (data))))
            (process-children)))
)

> For instance,  here is the code to generate the HREF attribute of a A Tag  from the content of MY_TAG tag.
> This code also generates the content of the A tag with the content of MY_TAG tag.
>
> (element MY_TAG
> ...
>    (make element gi: "TD"
>         (make sequence
>            (make formatting-instruction
>                  data: "&lt;A HREF=\"mailto:";
>            )
>            (process-children)
>            (make formatting-instruction
>                   data: "\"&gt;"
>            )
>            (process-children)
>            (make formatting-instruction
>  data: "&lt;/A&gt;"
>                               )
>                            )
>                 )
> ...
> )

--
Daniel Speck
Bureau of National Affairs, Inc.               Voice: +1 202.452.6596
1231 25th Street, NW                             Fax: +1 202.331.5178
Washington, DC 20037                          e-mail:  dspeck@xxxxxxx



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



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


Current Thread