From 4e76833eb8392d4a7e75b6f8836a77f8d4f01f3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Sat, 23 Dec 2023 17:00:53 +0100 Subject: Start work on namespaced xpath. --- tests/unit/sxml/namespaced-xpath.scm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/unit/sxml/namespaced-xpath.scm (limited to 'tests/unit/sxml') 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)) + + +'() -- cgit v1.2.3