aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/sxml/namespaced-xpath.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/sxml/namespaced-xpath.scm')
-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))
+
+
+'()