7.7
XML: Namespaces
This package extends the XML reader to extract namespace information from XML elements and attributes.
(require xml/ns) | package: xmlns |
procedure
(xml-expand-names doc) → document?
doc : document?
Returns a copy of doc with chaperones providing namespace information.
Element and attribute names are replaced with the local part.
procedure
(xml-expand-names/content content [ namespaces]) → content/c content : content/c
namespaces :
(hash/c (or/c symbol? #f) (or/c string? #f)) = (hasheq #f #f)
Returns a copy of content with chaperones providing namespace information.
Element and attribute names are replaced with the local part.
namespaces is a hash mapping name prefixes to namespace URIs.
procedure
(attribute-name-prefix att) → (or/c symbol? #f)
att : attribute?
Returns the namespace part, if any, of att’s name.
procedure
(attribute-namespace att) → (or/c string? #f)
att : attribute?
Returns the resolved namespace, if any, of att.
procedure
(element-name-prefix elt) → (or/c symbol? #f)
elt : element?
Returns the namespace part, if any, of elt’s name.
procedure
(element-namespace elt) → (or/c string? #f)
elt : element?
Returns the resolved namespace, if any, of elt.
struct
(struct exn:fail:xmlns exn:fail (element) #:extra-constructor-name make-exn:fail:xmlns) element : element?
Raised for errors when expanding element and attribute names.