aboutsummaryrefslogtreecommitdiff
path: root/module/sxml/namespaced/util.scm
diff options
context:
space:
mode:
Diffstat (limited to 'module/sxml/namespaced/util.scm')
-rw-r--r--module/sxml/namespaced/util.scm19
1 files changed, 4 insertions, 15 deletions
diff --git a/module/sxml/namespaced/util.scm b/module/sxml/namespaced/util.scm
index e05f2fa1..9a4e72d7 100644
--- a/module/sxml/namespaced/util.scm
+++ b/module/sxml/namespaced/util.scm
@@ -3,7 +3,7 @@
:use-module (srfi srfi-1)
:use-module ((ice-9 control) :select (call/ec))
:export (xml-element-hash-key
- find-element
+ find-child
element-matches?
root-element
))
@@ -13,12 +13,10 @@
(cons (xml-element-namespace tag)
(xml-element-tagname tag)))
-(define (find-element target list)
+(define (find-child target list)
(define target* (xml-element-hash-key target))
- (find (lambda (x) (and (list? x)
- (not (null? x))
- (xml-element? (car x))
- (equal? target* (xml-element-hash-key (car x)))))
+ (find (lambda (x) (and (xml-element? x)
+ (equal? target* (xml-element-hash-key x))))
list))
@@ -27,12 +25,3 @@
(equal?
(xml-element-hash-key target-el)
(xml-element-hash-key (car tree)))))
-
-
-(define (root-element tree)
- (cond ((and (eq? '*TOP* (car tree))
- (pi-element? (cadr tree)))
- (caddr tree))
- ((eq? '*TOP* (car tree))
- (cadr tree))
- (else tree)))