WebIt! implements an abstract datatype for the XML Infoset, in terms of the API described in this section. The concrete datatype used by this API is SXML.
normalized-sxmlparameter
By default, WebIt! functions and syntax can process non-normalized SXML. However, there is a performance penalty for this. normalized-sxml may be used to restrict WebIt! to processing a particular style of normalized SXML. The default value of #f enables processing of non-normalized SXML. Set this parameter to #t to restrict WebIt! to normalized SXML.
make-xml-documentfunction
make-xml-document :: list-of-nodes -> xml-document
This function construction a document node from a list of nodes. The list should include exactly one xml-element node.
xml-document?function
xml-document? :: node -> boolean
Returns #t if its argument is an xml-document node, otherwise #f.
xml-document-dtd-infofunction
xml-document-dtd-info :: xml-document -> xml-dtd-info
Returns the document's xml-dtd-info, if one is present, otherwise #f.
xml-document-contentfunction
xml-document-content :: xml-document -> xml-element
Returns the document's root element.
xml-document-bodyfunction
xml-document-content :: xml-document -> nodeset
Returns a list of the document's body nodes.
make-xml-elementfunction
make-xml-element :: tag attribute-list node-list -> xml-element
The element tag is a symbol.
The attribute-list is a list of attribute nodes: a list of an attribute tag and a string, number or boolean.
A node-list is a (possibly null) list of XML nodes.
make-xml-element/nsfunction
make-xml-element/ns :: tag ns-list attribute-list node-list -> xml-element
The element tag, tag, is a symbol.
ns-list is a list of namespace bindings. Each namespace binding is a list of a namespace uri (string) and a prefix (symbol).
The attribute-list is a list of attribute nodes: a list of an attribute tag and a string, number or boolean.
A node-list is a (possibly null) list of XML nodes.
xml-element?function
xml-element? :: node -> boolean
Returns #t if its argument is an xml-element node, otherwise #f.
xml-element-tagfunction
xml-element-tag :: xml-element -> symbol
Returns the tag (symbol) of an element node. This tag is either the local name of the element (for locally named element), or the concatenation of the namespace URI to which the element belongs and the element's local name, separated by a colon.
xml-element-local-namefunction
xml-element-local-name :: xml-element -> symbol
Returns the local-name (symbol) of an element node.
xml-element-ns-urifunction
xml-element-local-name :: xml-element -> symbol
Returns the namespace URI to which the element belongs, #f.
xml-element-ns-listfunction
xml-element-ns-list :: xml-element -> (listof xml-namespace-binding)
Returns a list of namespace prefix bindings associated with this element.
xml-element-attributesfunction
xml-element-attributes :: xml-element -> (listof xml-attribute)
Returns a list of attributes of this element.
xml-element-contentsfunction
xml-element-contents :: xml-element -> (listof node)
Returns a nodeset of the children of this element.
make-xml-attributefunction
make-xml-attribute :: tag value -> (list-of symbol string|number|boolean)
The attribute tag is a symbol.
The value of an attribute may be a string, number or boolean.
xml-attribute-tagfunction
xml-attribute-tag :: xml-attribute -> symbol
Returns the tag (symbol) of an attribute node. This tag is either the local name of the attribute (for locally named attributes), or the concatenation of the namespace URI to which the attribute belongs and the attribute's local name, separated by a colon.
xml-attribute-local-namefunction
xml-attribute-local-name :: xml-attribute -> symbol
Returns the local-name (symbol) of an attribute node.
xml-attribute-ns-urifunction
xml-attribute-local-name :: xml-attribute -> symbol
Returns the namespace URI to which the attribute belongs, #f.
xml-attribute-valuefunction
xml-attribute-value :: xml-attribute -> string|number|boolean
Returns the value of an attribute node.
make-xml-commentfunction
make-xml-comment :: string -> xml-comment
This function constructs an xml-comment object with its argument as the comment text.
xml-comment?function
xml-comment? :: node -> boolean
This function returns #t if its argument is an xml-comment, otherwise #f.
xml-comment-textfunction
xml-comment-text :: xml-comment -> string
Returns the text of an xml-comment node.
make-xml-pifunction
make-xml-pi :: symbol string -> xml-pi
This function has to arguments: a PI target (symbol) and PI text (a string). Returns a new xml-pi object.
xml-pi?function
xml-pi? :: node -> boolean
This function returns #t if its argument is an xml-comment, otherwise #f.
xml-pi-targetfunction
xml-pi-target :: xml-pi -> symbol
This function returns it's argument's PI target.
xml-pi-textfunction
xml-pi-text :: xml-pi -> symbol
This function returns it's argument's PI text.
make-xml-entityfunction
make-xml-entity :: string string -> xml-entity
This function takes two arguments of type string: a public-id and a system-id, and a returns a new xml-entity object.
xml-entity?function
xml-entity? :: node -> boolean
This function returns #t if its argument is an xml-entity, otherwise #f.
xml-entity-public-idfunction
xml-entity-public-id :: xml-entity -> string
This function returns it's argument's public-id.
xml-entity-system-idfunction
xml-entity-system-id :: xml-entity -> string
This function returns it's argument's system-id.
make-xml-ns-bindingfunction
make-xml-ns-binding :: symbol string -> (list symbol string)
This function takes two arguments: a namespace prefix (symbol) and a namespace URI (string), and returns a new namespace prefix binding.
xml-ns-binding-prefixfunction
xml-ns-binding-prefix :: (list symbol string) -> symbol
This function returns the namespace prefix from its argument.
xml-ns-binding-ns-urlfunction
xml-ns-binding-ns-url :: (list symbol string) -> string
This function returns the namespace URI from its argument.
make-xml-dtd-infofunction
make-xml-dtd-info :: symbol string -> xml-dtd-info
This function takes two arguments: a name (symbol) and a system (string). Returns a new xml-dtd-info object.
xml-dtd-info?function
xml-dtd-info? :: node -> boolean
This function returns #t if its argument is an xml-dtd-info or xml-dtd-info/public object, otherwise #f.
xml-dtd-info-namefunction
xml-dtd-info-name :: xml-dtd-info -> symbol
This function returns it's argument's name field.
xml-dtd-info-systemfunction
xml-dtd-info-system :: xml-dtd-info -> string
This function returns it's argument's system field.
make-xml-dtd-info/publicfunction
make-xml-dtd-info/public :: symbol string string -> xml-dtd-info/public
This function takes three arguments: a name (symbol), a system (string), and a public (string). Returns a new xml-dtd-info/public object.
xml-dtd-info/public?function
xml-dtd-info/public? :: node -> boolean
This function returns #t if its argument is an xml-dtd-info/public, otherwise #f.
xml-dtd-info/public-publicfunction
xml-dtd-info/public-public :: xml-dtd-info/public -> string
This function returns it's argument's public field.
nodeset?function
nodeset? :: any -> boolean
This function returns #t if its argument is a list which does not begin with a symbol, otherwise #f.
has-attribute?function
has-attribute? :: symbol (listof xml-attribute) -> (xml-attribute | #f)
This function searches a list of attributes for the for the requested attribute. Returns the matching attribute, otherwise #f.
bind-namespacessyntax
This form is used to introduce namespace prefix bindings, and to attach these bindings to an xml-element object.
The grammar for bind-namespaces is:
(bind-namespaces ([prefix-symbol uri-string] ...) expression)
Expression must evaluate to an xml-element. bind-namespaces returns a new xml-element object, with the new namespace prefix bindings.