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. > >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: "p" (make element gi: "a" 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 ><p ><a href="http://www.rittershofer.de" >http://www.rittershofer.de</a ></p ></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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: Updated dbtohtml.dsl -- DSSSL t, Norman Walsh | Thread | Repeated DSSSList posts stopped, DSSSList Owner |
Re: Updated dbtohtml.dsl -- DSSSL t, Norman Walsh | Date | Repeated DSSSList posts stopped, DSSSList Owner |
Month |