Subject: Complexity???
From: "Didier PH Martin" <martind@xxxxxxxxxxxxx>
Date: Sat, 8 May 1999 12:49:01 -0400

I just cached on the XSL list a generic script to display any XML document
like I did with DSSSL. There is minor differences between the two scripts
but you can judge by yourself the complexity comparison between XSL and
DSSSL. I hope that seeing the two beast in the same cage will reduce the
smoke, bell and whistle and the hype that often surrounds technologies.

PS: I'll modify the XSL script so that both scripts do exactly the same
thing (and post that in an article). I used the classic lisp based notation
for those with allergic reactions :-)))

Didier PH Martin

a) XSL scrip

<xsl:stylesheet xmlns:xsl="";>




    <xsl:template match="*">
      <DIV STYLE="margin-left:1em; color:red">
        &lt;<xsl:apply-templates for="@*"/>/&gt;

    <xsl:template match="*[node()]">
      <DIV STYLE="margin-left:1em">
        <SPAN STYLE="color:blue">&lt;
            <xsl:apply-templates select="@*"/>
            <xsl:apply-templates select="node()"/>
        <SPAN STYLE="color:green">&lt;/<xsl:attribute />

    <xsl:template match="@*">
      <SPAN STYLE="color:navy"> ="<SPAN STYLE="color:black"></SPAN>"</SPAN>

    <xsl:template match="pi()">
      <DIV STYLE="margin-left:1em; color:maroon">&lt;
        <xsl:apply-templates select="@*"/>


    <xsl:template match="textnode()">

<xsl:template match="/">
  <HTML><TITLE>XML via XSL sample</TITLE>
   <H1 STYLE="Font-family: Arial; color: blue">
    <img src="xmledi.gif" align="middle"/>
    XML via XSL sample


DSSSL script:
<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN">

(define *rgb-color-space*
  (color-space "ISO/IEC 10179:1996//Color-Space Family::Device RGB"))

 (define primary-blue-color
  (color *rgb-color-space* (/ 25 255) (/ 25 255) (/ 255 255)))

(define (copy-attributes nd indent)
  (let loop ((atts (named-node-list-names (attributes nd)))
             (resultstr ""))
    (if (null? atts)
          (cdr atts)
          (let* ((name (car atts))
                 (value (attribute-string name nd)))
            (if value

  (make scroll

  (make display-group
    start-indent: (+ (inherited-start-indent) 20pt)
    (make paragraph
      color:                          primary-blue-color
      font-weight:                    'light
   font-family-name: "Verdana"
   font-size:        10pt
       (gi (current-node))
       (copy-attributes (current-node) (string-append "  "))
    (if (node-property 'must-omit-end-tag?   (current-node))
	 (make paragraph
	    lines: 'asis
          font-weight:      'bold
          font-family-name: "Verdana"
          font-size:        10pt
	 (make paragraph
          color:  	    primary-blue-color
          font-weight:      'light
          font-family-name: "Verdana"
          font-size:        10pt
	    (literal "</" (gi (current-node)) ">"))))))

 DSSSList info and archive:

Current Thread
  • Complexity???
    • Didier PH Martin - Sat, 8 May 1999 14:04:40 -0400 (EDT) <=