121 lines
2.4 KiB
Scheme
121 lines
2.4 KiB
Scheme
(define-interface xml-structures-interface
|
|
(export source-start
|
|
source-stop
|
|
make-document document? document-prolog document-element document-misc
|
|
make-prolog prolog? prolog-misc prolog-dtd
|
|
make-element element? element-name element-attributes element-content
|
|
make-attribute attribute? attribute-name attribute-value
|
|
make-pcdata pcdata? pcdata-string
|
|
make-entity entity? entity-text
|
|
make-pi pi? pi-target-name pi-instruction
|
|
make-comment comment? comment-text
|
|
content?
|
|
make-start-tag start-tag? start-tag-name start-tag-attrs
|
|
make-end-tag end-tag? end-tag-name))
|
|
|
|
(define-structure xml-structures xml-structures-interface
|
|
(open scheme
|
|
extended-ports
|
|
define-record-types)
|
|
(files structures))
|
|
|
|
(define-interface plt-compat-interface
|
|
(export let-values
|
|
let*-values
|
|
add1 sub1
|
|
when unless
|
|
begin0
|
|
void
|
|
andmap
|
|
quicksort
|
|
make-parameter
|
|
let/ec call/ec
|
|
list* null
|
|
format
|
|
fprintf
|
|
regexp regexp-replace*
|
|
foldr
|
|
compose
|
|
open-output-string get-output-string
|
|
))
|
|
|
|
(define-structure plt-compat plt-compat-interface
|
|
(open scsh
|
|
scheme
|
|
string-lib
|
|
structure-refs)
|
|
(access big-scheme ;; format
|
|
list-lib) ;; fold
|
|
(files plt))
|
|
|
|
(define-interface reader-interface
|
|
(export read-xml
|
|
read-comments
|
|
collapse-whitespace))
|
|
|
|
(define-structure reader reader-interface
|
|
(open scsh ;read-string
|
|
scheme
|
|
xml-structures
|
|
i/o
|
|
i/o-internal
|
|
ports
|
|
plt-compat
|
|
signals)
|
|
(files reader))
|
|
|
|
(define-interface writer-interface
|
|
(export write-xml
|
|
display-xml
|
|
write-xml/content
|
|
display-xml/content
|
|
empty-tag-shorthand
|
|
html-empty-tags))
|
|
|
|
(define-structure writer writer-interface
|
|
(open scheme
|
|
xml-structures
|
|
signals
|
|
plt-compat)
|
|
(files writer))
|
|
|
|
|
|
(define-interface space-interface
|
|
(export eliminate-whitespace))
|
|
|
|
(define-structure space space-interface
|
|
(open scheme
|
|
plt-compat
|
|
signals
|
|
list-lib
|
|
xml-structures)
|
|
(files space))
|
|
|
|
(define-interface xexpr-interface
|
|
(export xml->xexpr
|
|
xexpr->xml
|
|
xexpr->string
|
|
xexpr-drop-empty-attributes))
|
|
|
|
(define-structure xexpr xexpr-interface
|
|
(open scheme
|
|
plt-compat
|
|
writer
|
|
signals
|
|
xml-structures)
|
|
(files xexpr))
|
|
|
|
(define-structure xml (compound-interface xml-structures-interface
|
|
reader-interface
|
|
writer-interface
|
|
xexpr-interface
|
|
space-interface)
|
|
(open scheme
|
|
plt-compat
|
|
xml-structures
|
|
reader
|
|
writer
|
|
xexpr
|
|
space))
|
|
|
|
|