This chapter describes the Bigloo API for Web programming.


The Bigloo web library supports tools helping Web programming. It contains XML, JSON, and CSS parsers, WebDAV tools, and function for handling the web formats of dates.


xml-parse input-port #!key (content-length 0) (make-element (lambda (tag attr body start-pos) (list tag attr body))) (make-comment (lambda (str pos) str)) (make-declaration (lambda (str pos) (cons 'declaration str))) (make-cdata (lambda (str pos) (cons 'cdata str))) (make-xml-declaration (lambda (attr pos) (cons 'xml-decl attr))) (make-instruction (lambda (str pos) (cons 'instruction str))) (specials '()) (strict #t) (encoding 'UTF-8) (eoi #f)bigloo procedure

Parses an XML documention. The arguments are:


html-parse input-port #!key (content-length 0) (procedure list) (encoding 'UTF-8) (eoi #f)bigloo procedure

Parse an HTML document. The optional arguments are:

This function is mere wrapper of xml-parse.

unhtml-port input-port output-port #!key tablebigloo procedure

Removes tags from input-port and write the result to output-port. If provided, table must a hashtable associating HTML escape sequences (e.g., "&") to strings used in the replacement.

unhtml str::bstring #!optional tablebigloo procedure

Removes HTML tags from the string str.

xml-string-decode strbigloo procedure

xml-string-decode! strbigloo procedure

xml-string-encode strbigloo procedure

Decode/encode XML strings.

(xml-string-decode "foo>bar gee")   "foo>bar gee"

html-string-decode strbigloo procedure

html-string-encode strbigloo procedure

Decode/encode HTML strings.

(xml-string-decode "foo&baruot;gee")   "foo&bar\"gee"


This section describes the functions that may help implementing WebDAV servers and clients.


The class used to raised access denied. It contains one field:


webdav-directory->list url #!key (timeout 0) (proxy #f)bigloo procedure

webdav-directory->path-list url #!key (timeout 0) (proxy #f)bigloo procedure

The list of files, respec. urls, in the directory url.

webdav-directory->prop-list url #!key (timeout 0) (proxy #f)bigloo procedure

The list of properties of a WebDAV repository.

webdav-file-exists? url #!key (timeout 0) (proxy #f)bigloo procedure

Return #t if and only if url exists, returns #f otherwise.

webdav-directory? url #!key (timeout 0) (proxy #f) bigloo procedure

Return #t if and only if url is a directory, returns #f otherwise.

webdav-file-modification-time url #!key (timeout 0) (proxy #f)bigloo procedure

The last modification time of url.

webdav-file-size url #!key (timeout 0) (proxy #f)bigloo procedure

The file size.

webdav-delete-file url #!key (timeout 0) (proxy #f)bigloo procedure

webdav-delete-directory url #!key (timeout 0) (proxy #f)bigloo procedure

Delete a file, respec. a directory.

webdav-make-directory url #!key (timeout 0) (proxy #f)bigloo procedure

webdav-make-directories url #!key (timeout 0) (proxy #f)bigloo procedure

Create a directory, respec. a directory hierarchy.

webdav-rename-file url dst #!key (timeout 0) (proxy #f)bigloo procedure

webdav-cop-file url dst #!key (timeout 0) (proxy #f)bigloo procedure

Rename, respec. copy, a WebDAV file.

webdav-put-file url obj #!key (timeout 0) (proxy #f)bigloo procedure

Create a WebDAV file at url whose content is obj.


CSS files and rules are internally represented as an abstract syntax tree defined by the css class hierarchy given belown.

The type of fields whose names end with * is pair-nil. The type of fields whose names end with + is pair.

css-url value::bstringclass

css-ext value::bstringclass

css-stylesheed charset comment* import* rule*-nilclass

css-charset charset::bstring spec::bstringclass

css-comment cdo::bstring cdc::bstring contentclass

css-import value medium*class

css-media medium+ ruleset*class

css-media-query operator type::bstring expr*class

css-page ident pseudopage declaration*class

css-fontface declaration*class

css-keyframes operator::bstring ident::bstring keyframe*class

css-pseudopage identclass

css-ruleset stamp::int specificity selector+ declaration*class

css-keyframe selector declaration*class

css-selector element attr*class

css-selector-class nameclass

css-selector-hash nameclass

css-selector-name nameclass

css-selector-attr ident op argclass

css-selector-pseudo expr funclass

css-declaration proprety expr prioclass

css-function fun exprclass

css-hash-color value::bstringclass


css-write ast o::output-portbigloo procedure

Output a CSS AST into a CSS document.

css->ast::css-stylesheet i::input-port #!key extension eoffbigloo procedure

Parses a CSS document.


w3c-datetime-timestampbigloo procedure

Returns the current date as a w3c datetime.

w3c-datetime->datebigloo procedure

date->w3c-datetimebigloo procedure

Convert from and to Bigloo Dates and W3C dates.


json-parse i::input-port #!key array-alloc array-set array-return object-alloc object-set object-return parse-error (undefined #t) reviver expr constant-alloc string-allocbigloo procedure

Parses a JSON document. The keywored arguments are: