aboutsummaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2023-12-23 17:00:53 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2023-12-23 17:00:53 +0100
commit4e76833eb8392d4a7e75b6f8836a77f8d4f01f3d (patch)
tree5127ef6b8af7b80a45fe81171912c9b9d8ae2c66 /tests/unit
parentUpdate things depending on namespaced sxml. (diff)
downloadcalp-4e76833eb8392d4a7e75b6f8836a77f8d4f01f3d.tar.gz
calp-4e76833eb8392d4a7e75b6f8836a77f8d4f01f3d.tar.xz
Start work on namespaced xpath.namespaced-xpath
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/sxml/namespaced-xpath.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/sxml/namespaced-xpath.scm b/tests/unit/sxml/namespaced-xpath.scm
new file mode 100644
index 00000000..e625d514
--- /dev/null
+++ b/tests/unit/sxml/namespaced-xpath.scm
@@ -0,0 +1,28 @@
+(define-module (test sxml namespaced-xpath)
+ :use-module (srfi srfi-64)
+ :use-module (srfi srfi-64 test-error)
+ :use-module (srfi srfi-88)
+ :use-module ((sxml xpath) :prefix #{x:}#)
+ :use-module (sxml namespaced)
+ :use-module (sxml namespaced util))
+
+(define html '(html (body (a (@ (href "#") (alt "Test")) "Hello")
+ (a (@ (href "/")) "World"))))
+
+(define xmlns:html 'http://www.w3.org/1999/xhtml)
+
+(define xhtml
+ ((xml xmlns:html 'html)
+ ((xml xmlns:html 'body)
+ ((xml xmlns:html 'a `((href "#") (alt "Test"))) "Hello")
+ ((xml xmlns:html 'a `((href "/"))) "World")
+ ))
+ )
+
+(test-equal
+ (list '(a (@ (href "#") (alt "Test")) "Hello"))
+ ((x:sxpath '(// (a ((@ ((href ((equal? "#")))))))))
+ html))
+
+
+'()