aboutsummaryrefslogtreecommitdiff
path: root/module/sxml/namespaced/util.scm
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-12-13 11:06:57 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2023-12-13 11:17:34 +0100
commit00a66eca0f32fcf585d2c21375641020e877e3ea (patch)
treec2aceeb5047bf46e03726e1c5e8378cf86a4df63 /module/sxml/namespaced/util.scm
parentFix sxml namespaced util. (diff)
downloadcalp-00a66eca0f32fcf585d2c21375641020e877e3ea.tar.gz
calp-00a66eca0f32fcf585d2c21375641020e877e3ea.tar.xz
Update things depending on namespaced sxml.sxml-work
Update all code to emit correctly formed namespaced sxml objects, instead of the old list based approach. Also introduces a number of typechecks which in semi-related parts of the code. Note that the webdav-server test is currently broken.
Diffstat (limited to 'module/sxml/namespaced/util.scm')
-rw-r--r--module/sxml/namespaced/util.scm3
1 files changed, 3 insertions, 0 deletions
diff --git a/module/sxml/namespaced/util.scm b/module/sxml/namespaced/util.scm
index 9a4e72d7..e60254b7 100644
--- a/module/sxml/namespaced/util.scm
+++ b/module/sxml/namespaced/util.scm
@@ -2,6 +2,7 @@
:use-module (sxml namespaced)
:use-module (srfi srfi-1)
:use-module ((ice-9 control) :select (call/ec))
+ :use-module (hnh util type)
:export (xml-element-hash-key
find-child
element-matches?
@@ -14,6 +15,8 @@
(xml-element-tagname tag)))
(define (find-child target list)
+ (typecheck target xml-element?)
+ (typecheck list (list-of (or xml-element? string?)))
(define target* (xml-element-hash-key target))
(find (lambda (x) (and (xml-element? x)
(equal? target* (xml-element-hash-key x))))