Re: new to dsssl: URL as href in HTML

Subject: Re: new to dsssl: URL as href in HTML
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxx>
Date: Sat, 21 Nov 1998 20:23:15 -0800
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: "h1"
                  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