;======================================================================== ; Highest-level parsers: XML to SXML (module ssax (ssax:read-char-data xml-token-kind xml-token-head (ssax:make-parser fold) (ssax:make-pi-parser fold) (ssax:make-elem-parser fold) ssax:xml->sxml ssax:warn) (import (except scheme string) chicken ports srfi-13) (import (except extras read-string) (except srfi-1 fold fold-right cons*)) (require-extension input-parse) (define ucscode->char integer->char) (define ascii->char integer->char) (define char-return (ascii->char 13)) (define char-tab (ascii->char 9)) (define char-newline (ascii->char 10)) ;; SSAX.scm expects STRING to work on characters > #\u00ff; ;; this allows entities > 255 to be parsed correctly. (define (string x) (##sys#char->utf8-string x)) (define parser-error error) (define (ssax:warn port msg . other-msg) (apply cerr (cons* nl "Warning: " msg other-msg))) (include "myenv-chicken.scm") (include "look-for-str.scm") (include "SSAX.scm") )