Web

This chapter describes the Bigloo API for Web programming.

Overview

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

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:

.keep

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.
.keep

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.
.keep

unhtml str::bstring #!optional tablebigloo procedure

Removes HTML tags from the string str.
.keep

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"
.keep

html-string-decode strbigloo procedure

html-string-encode strbigloo procedure

Decode/encode HTML strings.

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

WebDAV

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

&webdav-access-control-exception::&access-control-exceptionclass

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

.keep

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.
.keep

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

The list of properties of a WebDAV repository.
.keep

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

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

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

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

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

The last modification time of url.
.keep

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

The file size.
.keep

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.
.keep

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.
.keep

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.
.keep

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

Create a WebDAV file at url whose content is obj.
.keep

CSS

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

.keep

css-write ast o::output-portbigloo procedure

Output a CSS AST into a CSS document.
.keep

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

Parses a CSS document.
.keep

Date

w3c-datetime-timestampbigloo procedure

Returns the current date as a w3c datetime.
.keep

w3c-datetime->datebigloo procedure

date->w3c-datetimebigloo procedure

Convert from and to Bigloo Dates and W3C dates.
.keep

JSON

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:

.keep