Re: new to dsssl: URL as href in HTML (RETRY)

Subject: Re: new to dsssl: URL as href in HTML (RETRY)
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxx>
Date: Sun, 22 Nov 1998 08:44:02 -0800
(in my haste to hack one example into another example, I neglected to
change the generic identifier of my desired output element; here is the
repaired script.)

At 98/11/20 19:29 +0100, Andreas Rittershofer wrote:
>I have a simple DTD with a tag named <url>
>Now I want to transform a valid XML-file to HTML.
>In XML:
>I want this to be in HTML:
><a href="";>

The (data) function will help you put text into an attribute value.

I hope the example below helps.

....... Ken

D:\temp\jade>type test.xml
<?xml version="1.0"?>

D:\temp\jade>type test.dsl
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

(declare-flow-object-class element
  "UNREGISTERED::James Clark//Flow Object Class::element")

    (make element gi: "html"
        (make element gi: "head"
            (make element gi: "title"
                (literal "Test file")))
        (make element gi: "body"
(element url
    (make element gi: "p"
        (make element gi: "a"
                      attributes: (list (list "href" (data (current-node))))
; end of file
D:\temp\jade>jade -c p:\jade\jadecurr\catalog -wno-valid -t sgml test.xml

D:\temp\jade>type test.htm
>Test file</title

G. Ken Holman               mailto:gkholman@xxxxxxxxxxxxxx
Crane Softwrights Ltd.
Box 266,                                V: +1(613)489-0999
Kars, Ontario CANADA K0A-2E0            F: +1(613)489-0995

 DSSSList info and archive:

Current Thread