Changeset 36167 in project


Ignore:
Timestamp:
08/11/18 20:36:45 (13 months ago)
Author:
sjamaan
Message:

Port sxml-serializer to CHICKEN 5

Location:
release/5/sxml-serializer
Files:
1 added
2 deleted
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • release/5/sxml-serializer/trunk/serializer.scm

    r19059 r36167  
    907907
    908908
    909 
    910 
    911909;==========================================================================
    912910; Recursively walking the tree of SXML elements
  • release/5/sxml-serializer/trunk/sxml-serializer.egg

    r36115 r36167  
    11;; -*- scheme -*-
    22
    3 ((synopsis
    4    "Serialize SXML to XML and HTML")
     3((synopsis "Serialize SXML to XML and HTML")
    54 (author "Dmitry Lizorkin")  ;; port by Jim Ursetto
    65 (license "BSD")             ;; Dmitry's code is PD
    7  (doc-from-wiki)
    8  (category xml))
     6 (category xml)
     7 (dependencies srfi-1 srfi-13)
     8 (components (extension sxml-serializer
     9                        (source-dependencies "serializer.scm")
     10                        (csc-options "-O3" "-d0"))))
  • release/5/sxml-serializer/trunk/sxml-serializer.scm

    r29642 r36167  
    2323  ;; sxml->html
    2424  ;; sxml->html/noindent
    25  
    2625  )
    2726
    28 (import scheme chicken)
    29 (require-library srfi-1 srfi-13)
     27(import scheme (chicken base))
    3028(import (only srfi-1 filter)
    3129        (only srfi-13 string-concatenate))
     
    123121      (list " xmlns:" prefix-string "=\""
    124122            (srl:string->att-value namespace-uri) "\"")))
    125 
    126 ;; Similar to data-structures#alist-update!, but is non-destructive.
    127 ;; Returns a new list with (key . val) consed onto the front;
    128 ;; if KEY already exists in the alist, that pair is omitted from the
    129 ;; returned list.  Currently traverses the entire list and removes all matching keys.
    130 (define (alist-update key val alist #!optional (cmp eqv?))
    131   (cons (cons key val)
    132         (let loop ((alist alist) (res '()))
    133           (cond ((null? alist)
    134                  (reverse res))
    135                 ((cmp key (caar alist))
    136                  (loop (cdr alist) res))
    137                 (else
    138                  (loop (cdr alist) (cons (car alist) res)))))))
    139123
    140124;; Changes: When declaring a namespace prefix, remove any existing matching prefixes
Note: See TracChangeset for help on using the changeset viewer.