diff options
author | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-12-23 17:00:53 +0100 |
---|---|---|
committer | Hugo Hörnquist <hugo@lysator.liu.se> | 2023-12-23 17:00:53 +0100 |
commit | 4e76833eb8392d4a7e75b6f8836a77f8d4f01f3d (patch) | |
tree | 5127ef6b8af7b80a45fe81171912c9b9d8ae2c66 /tests | |
parent | Update things depending on namespaced sxml. (diff) | |
download | calp-namespaced-xpath.tar.gz calp-namespaced-xpath.tar.xz |
Start work on namespaced xpath.namespaced-xpath
Diffstat (limited to 'tests')
-rw-r--r-- | tests/unit/sxml/namespaced-xpath.scm | 28 |
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)) + + +'() |