Re: JADE--SGML Backend--attributes

Subject: Re: JADE--SGML Backend--attributes
From: Jany Quintard <quintard.j@xxxxxx>
Date: Wed, 24 Mar 1999 14:12:48 +0100 (MET)
On Wed, 24 Mar 1999, 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) ?
> 
> I do use the formatting-instruction sosofo to do the job but it requires to generate " by hand " the syntax :
> 
> 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;"
>                               )
We use the attributes: to generate the attributes of an element A in the
following way :

(element MY_TAG
    (make element gi: "A"
      attributes: (list (list "HREF" 
           (string-append "#" (attribute-string "REFID"))))
                 (literal "»")))
or 

(make element gi: "A"
        attributes:
          (list
            (list "NAME" (string-append "TOC" (section-id
(current-node))))
            (list "TITLE" "To document")
            (list "HREF" (string-append "#BODY" (section-id
                                                       (current-node)))))
        (make sequence 
               (literal 
                (format-number-list 
                 (hierarchical-number-recursive "D" ) "1" ".")
                " ")
               (process-children-trim))))

We use this to build TOCs with bidirectionnal links.
Could this help you ?

Jany.


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


Current Thread