Re: Interesting problem

Subject: Re: Interesting problem
From: Joerg Wittenberger <Joerg.Wittenberger@xxxxxxxxx>
Date: Mon, 16 Aug 1999 18:28:04 +0200 (CEST)
> A very interesting problem has been posted on the XSL list. How would we
> resolve it in DSSSL. I'll take the best solution from both world and publish
> it.
> 
> Suppose I had the following XML fragment:
> 
>     <entry>
>       <key>foo</key>
>       <description>A sample link</description>
>     </entry>
> 
> Suppose I would like to create the following output using XT:
> 
>     <a href="http://www.frob.org/search?type=simple&key=foo";>A sample
> link</a>
> 
> How would I go about this?  My problem is how to create the `href'
> attribute of the output element `a', in particular how to concat the
> constant string "http://www.frob.org/search?type=simple&key="; and the
> content of the `key' input element.

If I got the question right, the following untested code fragment
should do the trick using jade's sgml extension FOs.

(element (entry key) (empty-sosofo))
(element entry
  (make element
    gi: "a"
    attributes: `(("href"
                   ,(string-append
                      "http://www.frob.org/search?type=simple&key=";
                      (data (select (children (current-node)  "key"))))))
    (process-children)))

But I think the real question has been how to do that without "make
element", hasn't it?


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


Current Thread