cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ovi...@apache.org
Subject cvs commit: xml-cocoon2/scratchpad/schecoon/scheme test.scm
Date Fri, 14 Dec 2001 20:39:55 GMT
ovidiu      01/12/14 12:39:55

  Modified:    scratchpad/schecoon/scheme test.scm
  Log:
  Simple working example of a sitemap.
  
  Revision  Changes    Path
  1.3       +45 -7     xml-cocoon2/scratchpad/schecoon/scheme/test.scm
  
  Index: test.scm
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/scratchpad/schecoon/scheme/test.scm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- test.scm	2001/12/12 17:49:45	1.2
  +++ test.scm	2001/12/14 20:39:55	1.3
  @@ -1,9 +1,47 @@
   (load-module "sisc.modules.J2S")
   
  -(define plus
  -   (lambda (a b)
  -      (+ a b)))
  -
  -(define main
  -  (lambda ()
  -    (+ 1 2)))
  +(define (main url request response)
  +  (the-sitemap url)
  +)
  +
  +;;; sample example of a sitemap
  +(define pipelines
  +  (define-pipelines
  +    (define-pipeline docbook-xhtml
  +      (lambda (file . args)
  +	(generate file)
  +	(transform '((type xslt)
  +		     (name "docbook2xhtml.xsl")
  +		     (parameter "view-source" (concat "docs/samples/" file))))
  +	(serialize (type xml))))
  +    
  +    (define-pipeline gif-image
  +      (lambda (file . args)
  +	(read (concat "src/" file ".gif") "image/gif")))
  +    ))
  +
  +
  +(define the-sitemap
  +  (define-sitemap
  +    (match "sql/(.*)"
  +	   (lambda (file . args)
  +	     (write (list 'call-pipeline 'docbook-xhtml file))))
  +
  +    (match "slides/(.*)\.gif"
  +	   (lambda (file . args)
  +	     (write '(call-pipeline gif-image file))))
  +
  +    (match "view-source/*"
  +	   (lambda (file . args)
  +	     (write '(generate file)) (newline)
  +	     (write '(transform '((type xslt) (name "xsp"))))  (newline)
  +	     (write '(serialize (type xml)))  (newline)))
  +
  +    (match "shopping-cart"
  +	   (shopping-cart))
  +    ))
  +
  +(define (shopping-cart)
  +;  (display "shopping cart invoked") (newline)
  +  #f
  +)
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message