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.
>
>Example:
>
>In XML:
>
><url>
>  http://www.rittershofer.de
></url>
>
>I want this to be in HTML:
>
><a href="http://www.rittershofer.de";>http://www.rittershofer.de
</a>

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"?>
<url>http://www.rittershofer.de</url>

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")

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

D:\temp\jade>type test.htm
<html
><head
><title
>Test file</title
></head
><body
><h1
href="http://www.rittershofer.de";
>http://www.rittershofer.de</h1
></body
></html
>
D:\temp\jade>



--
G. Ken Holman               mailto:gkholman@xxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/d/
Box 266,                                V: +1(613)489-0999
Kars, Ontario CANADA K0A-2E0            F: +1(613)489-0995
Training:   http://www.CraneSoftwrights.com/d/schedule.htm
Resources: http://www.CraneSoftwrights.com/d/resources.htm
Shareware: http://www.CraneSoftwrights.com/d/shareware.htm


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


Current Thread