diff --git a/README.md b/README.md
index 5c35332..eee00ae 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,11 @@
-# cl-xml
-
-> **Note:** cl-xml is a temporary name as it is already taken on Quicklisp.
+# io.github.cl-sdk.xml
A Common Lisp XML reader, writer, and custom parser.
## Installation
```lisp
-(ql:quickload "cl-xml")
+(ql:quickload "io.github.cl-sdk.xml")
```
## Parsing
@@ -22,7 +20,7 @@ A Common Lisp XML reader, writer, and custom parser.
```lisp
(defvar *doc*
- (cl-xml:parse-xml "
+ (io.github.cl-sdk.xml:parse-xml "
- hello & world
@@ -39,18 +37,18 @@ Provide a subclass of `sax-handler` and pass an instance as `:handler` to
methods are no-ops.
```lisp
-(defclass my-handler (cl-xml:sax-handler) ())
+(defclass my-handler (io.github.cl-sdk.xml:sax-handler) ())
-(defmethod cl-xml:start-element ((h my-handler) tag attributes)
+(defmethod io.github.cl-sdk.xml:start-element ((h my-handler) tag attributes)
(format t "open ~a ~a~%" tag attributes))
-(defmethod cl-xml:end-element ((h my-handler) tag)
+(defmethod io.github.cl-sdk.xml:end-element ((h my-handler) tag)
(format t "close ~a~%" tag))
-(defmethod cl-xml:end-document ((h my-handler))
+(defmethod io.github.cl-sdk.xml:end-document ((h my-handler))
:done)
-(cl-xml:parse-xml "" :handler (make-instance 'my-handler))
+(io.github.cl-sdk.xml:parse-xml "" :handler (make-instance 'my-handler))
;; open root nil
;; open child nil
;; close child
@@ -81,10 +79,10 @@ The top-level result of `parse-xml`.
| `xml-document-root` | the root `xml-node` |
```lisp
-(cl-xml:xml-document-prolog *doc*)
+(io.github.cl-sdk.xml:xml-document-prolog *doc*)
;; => (# #)
-(cl-xml:xml-node-tag (cl-xml:xml-document-root *doc*))
+(io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root *doc*))
;; => "root"
```
@@ -97,11 +95,11 @@ The top-level result of `parse-xml`.
| `xml-node-children` | list of child nodes (see node types below) |
```lisp
-(let* ((root (cl-xml:xml-document-root *doc*))
- (item (first (cl-xml:xml-node-children root))))
- (cl-xml:xml-node-tag item) ; => "item"
- (cl-xml:xml-node-attributes item) ; => (("id" . "1"))
- (cl-xml:xml-node-children item)) ; => ("hello & world")
+(let* ((root (io.github.cl-sdk.xml:xml-document-root *doc*))
+ (item (first (io.github.cl-sdk.xml:xml-node-children root))))
+ (io.github.cl-sdk.xml:xml-node-tag item) ; => "item"
+ (io.github.cl-sdk.xml:xml-node-attributes item) ; => (("id" . "1"))
+ (io.github.cl-sdk.xml:xml-node-children item)) ; => ("hello & world")
```
### xml-comment
@@ -155,7 +153,7 @@ Whitespace-only character data between elements is discarded.
## References
-cl-xml is a hand-written recursive-descent parser implemented in Common Lisp.
+io.github.cl-sdk.xml is a hand-written recursive-descent parser implemented in Common Lisp.
It targets the specifications listed below.
- [Extensible Markup Language (XML) 1.0](https://www.w3.org/TR/xml/) — the core grammar and well-formedness rules that govern parsing, character data, entity references, comments, CDATA sections, processing instructions, and the document prolog.
diff --git a/api.lisp b/api.lisp
index 6336b09..6ecda83 100644
--- a/api.lisp
+++ b/api.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; Event-to-handler bridge
diff --git a/chars.lisp b/chars.lisp
index cb09bb2..9abf892 100644
--- a/chars.lisp
+++ b/chars.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; Character classification — XML 1.0 §2.3
diff --git a/dom-builder.lisp b/dom-builder.lisp
index 3e01cb2..e4249e5 100644
--- a/dom-builder.lisp
+++ b/dom-builder.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; Default DOM-building SAX handler
diff --git a/events.lisp b/events.lisp
index cdc95e0..c572016 100644
--- a/events.lisp
+++ b/events.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; XML event types — the intermediate representation between the tokeniser
;;; and any downstream processor (SAX handler, validator, etc.).
diff --git a/flake.nix b/flake.nix
index cbc71f1..003867d 100644
--- a/flake.nix
+++ b/flake.nix
@@ -1,5 +1,5 @@
{
- description = "cl-xml";
+ description = "io.github.cl-sdk.xml";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-25.11";
diff --git a/cl-soap.asd b/io.github.cl-sdk.soap.asd
similarity index 74%
rename from cl-soap.asd
rename to io.github.cl-sdk.soap.asd
index b6345b9..4680fbc 100644
--- a/cl-soap.asd
+++ b/io.github.cl-sdk.soap.asd
@@ -1,5 +1,5 @@
-(defsystem #:cl-soap
- :description "SOAP 1.1/1.2 support for cl-xml."
+(defsystem #:io.github.cl-sdk.soap
+ :description "SOAP 1.1/1.2 support for io.github.cl-sdk.xml."
:version "0.1.0"
:author "Bruno Dias "
:maintainer "Bruno Dias "
@@ -7,6 +7,6 @@
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml)
+ :depends-on (#:io.github.cl-sdk.xml)
:components ((:file "soap-package")
(:file "soap" :depends-on ("soap-package"))))
diff --git a/cl-soap.test.asd b/io.github.cl-sdk.soap.test.asd
similarity index 72%
rename from cl-soap.test.asd
rename to io.github.cl-sdk.soap.test.asd
index 897e20c..616eb97 100644
--- a/cl-soap.test.asd
+++ b/io.github.cl-sdk.soap.test.asd
@@ -1,12 +1,12 @@
-(defsystem #:cl-soap.test
- :description "Tests for cl-soap."
+(defsystem #:io.github.cl-sdk.soap.test
+ :description "Tests for io.github.cl-sdk.xml.soap."
:version "0.1.0"
:author "Bruno Dias "
:license "Unlicense"
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml #:cl-soap #:fiveam)
+ :depends-on (#:io.github.cl-sdk.xml #:io.github.cl-sdk.soap #:fiveam)
:components ((:module "t"
:components
((:file "cl-soap-package")
diff --git a/cl-wsdl.asd b/io.github.cl-sdk.wsdl.asd
similarity index 75%
rename from cl-wsdl.asd
rename to io.github.cl-sdk.wsdl.asd
index 284c841..ce575af 100644
--- a/cl-wsdl.asd
+++ b/io.github.cl-sdk.wsdl.asd
@@ -1,5 +1,5 @@
-(defsystem #:cl-wsdl
- :description "WSDL 2.0 support for cl-xml."
+(defsystem #:io.github.cl-sdk.wsdl
+ :description "WSDL 2.0 support for io.github.cl-sdk.xml."
:version "0.1.0"
:author "Bruno Dias "
:maintainer "Bruno Dias "
@@ -7,6 +7,6 @@
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml)
+ :depends-on (#:io.github.cl-sdk.xml)
:components ((:file "wsdl-package")
(:file "wsdl" :depends-on ("wsdl-package"))))
diff --git a/cl-wsdl.test.asd b/io.github.cl-sdk.wsdl.test.asd
similarity index 72%
rename from cl-wsdl.test.asd
rename to io.github.cl-sdk.wsdl.test.asd
index da3a91e..43c7f5b 100644
--- a/cl-wsdl.test.asd
+++ b/io.github.cl-sdk.wsdl.test.asd
@@ -1,12 +1,12 @@
-(defsystem #:cl-wsdl.test
- :description "Tests for cl-wsdl."
+(defsystem #:io.github.cl-sdk.wsdl.test
+ :description "Tests for io.github.cl-sdk.xml.wsdl."
:version "0.1.0"
:author "Bruno Dias "
:license "Unlicense"
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml #:cl-wsdl #:fiveam)
+ :depends-on (#:io.github.cl-sdk.xml #:io.github.cl-sdk.wsdl #:fiveam)
:components ((:module "t"
:components
((:file "cl-wsdl-package")
diff --git a/cl-xml.asd b/io.github.cl-sdk.xml.asd
similarity index 97%
rename from cl-xml.asd
rename to io.github.cl-sdk.xml.asd
index e096d7f..a8778f9 100644
--- a/cl-xml.asd
+++ b/io.github.cl-sdk.xml.asd
@@ -1,4 +1,4 @@
-(defsystem #:cl-xml
+(defsystem #:io.github.cl-sdk.xml
:description "A Common Lisp XML reader, writer, and custom parser."
:long-description #.(uiop:read-file-string
(uiop:subpathname *load-pathname* "README.md"))
diff --git a/cl-xml.test.asd b/io.github.cl-sdk.xml.test.asd
similarity index 70%
rename from cl-xml.test.asd
rename to io.github.cl-sdk.xml.test.asd
index 063b473..adf4813 100644
--- a/cl-xml.test.asd
+++ b/io.github.cl-sdk.xml.test.asd
@@ -1,12 +1,12 @@
-(defsystem #:cl-xml.test
- :description "Tests for cl-xml."
+(defsystem #:io.github.cl-sdk.xml.test
+ :description "Tests for io.github.cl-sdk.xml."
:version "0.1.0"
:author "Bruno Dias "
:license "Unlicense"
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml #:fiveam #:trivial-gray-streams)
+ :depends-on (#:io.github.cl-sdk.xml #:fiveam #:trivial-gray-streams)
:components ((:module "t"
:components
((:file "package")
diff --git a/cl-xsd.asd b/io.github.cl-sdk.xsd.asd
similarity index 72%
rename from cl-xsd.asd
rename to io.github.cl-sdk.xsd.asd
index 8f1094e..3bd60e7 100644
--- a/cl-xsd.asd
+++ b/io.github.cl-sdk.xsd.asd
@@ -1,5 +1,5 @@
-(defsystem #:cl-xsd
- :description "XSD (XML Schema Definition) support for cl-xml."
+(defsystem #:io.github.cl-sdk.xsd
+ :description "XSD (XML Schema Definition) support for io.github.cl-sdk.xml."
:version "0.1.0"
:author "Bruno Dias "
:maintainer "Bruno Dias "
@@ -7,6 +7,6 @@
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml)
+ :depends-on (#:io.github.cl-sdk.xml)
:components ((:file "xsd-package")
(:file "xsd" :depends-on ("xsd-package"))))
diff --git a/cl-xsd.test.asd b/io.github.cl-sdk.xsd.test.asd
similarity index 72%
rename from cl-xsd.test.asd
rename to io.github.cl-sdk.xsd.test.asd
index 957f96e..650bb7c 100644
--- a/cl-xsd.test.asd
+++ b/io.github.cl-sdk.xsd.test.asd
@@ -1,12 +1,12 @@
-(defsystem #:cl-xsd.test
- :description "Tests for cl-xsd."
+(defsystem #:io.github.cl-sdk.xsd.test
+ :description "Tests for io.github.cl-sdk.xml.xsd."
:version "0.1.0"
:author "Bruno Dias "
:license "Unlicense"
:homepage "https://github.com/cl-sdk/cl-xml"
:source-control (:git "https://github.com/cl-sdk/cl-xml")
:bug-tracker "https://github.com/cl-sdk/cl-xml/issues"
- :depends-on (#:cl-xml #:cl-xsd #:fiveam)
+ :depends-on (#:io.github.cl-sdk.xml #:io.github.cl-sdk.xsd #:fiveam)
:components ((:module "t"
:components
((:file "cl-xsd-package")
diff --git a/namespace.lisp b/namespace.lisp
index c30ccfa..7c26c73 100644
--- a/namespace.lisp
+++ b/namespace.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; Namespace resolution — Namespaces in XML 1.0
diff --git a/package.lisp b/package.lisp
index 0488a2a..4a98338 100644
--- a/package.lisp
+++ b/package.lisp
@@ -1,4 +1,4 @@
-(defpackage #:cl-xml
+(defpackage #:io.github.cl-sdk.xml
(:use #:cl #:trivial-gray-streams)
(:export
;; Document
diff --git a/sax.lisp b/sax.lisp
index 5464752..6a93e1c 100644
--- a/sax.lisp
+++ b/sax.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; SAX handler protocol — event-driven parsing interface
diff --git a/soap-package.lisp b/soap-package.lisp
index 5f799f8..afa2fae 100644
--- a/soap-package.lisp
+++ b/soap-package.lisp
@@ -1,5 +1,5 @@
-(defpackage #:cl-soap
- (:use #:cl #:cl-xml)
+(defpackage #:io.github.cl-sdk.soap
+ (:use #:cl #:io.github.cl-sdk.xml)
(:export
;; SOAP namespace URI constants
#:+soap-1.1-namespace+
diff --git a/soap.lisp b/soap.lisp
index 1ce91ac..d4453c8 100644
--- a/soap.lisp
+++ b/soap.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-soap)
+(in-package #:io.github.cl-sdk.soap)
;;;; SOAP (Simple Object Access Protocol) — 1.1 and 1.2 implementation
;;;;
diff --git a/structures.lisp b/structures.lisp
index 21ead04..19963a9 100644
--- a/structures.lisp
+++ b/structures.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml)
+(in-package #:io.github.cl-sdk.xml)
;;; Data structures
diff --git a/t/cl-soap-package.lisp b/t/cl-soap-package.lisp
index 22aa4e1..52ea7ca 100644
--- a/t/cl-soap-package.lisp
+++ b/t/cl-soap-package.lisp
@@ -1,3 +1,3 @@
-(defpackage #:cl-soap.test
- (:use #:cl #:fiveam #:cl-soap)
+(defpackage #:io.github.cl-sdk.soap.test
+ (:use #:cl #:fiveam #:io.github.cl-sdk.soap)
(:export #:cl-soap-suite))
diff --git a/t/cl-soap-tests.lisp b/t/cl-soap-tests.lisp
index 58d2459..3db3a48 100644
--- a/t/cl-soap-tests.lisp
+++ b/t/cl-soap-tests.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-soap.test)
+(in-package #:io.github.cl-sdk.soap.test)
(def-suite cl-soap-suite
:description "Test suite for cl-soap.")
@@ -12,46 +12,46 @@
(test soap-namespace-constants
"SOAP namespace URI constants have the correct values."
(is (string= "http://schemas.xmlsoap.org/soap/envelope/"
- cl-soap:+soap-1.1-namespace+))
+ io.github.cl-sdk.soap:+soap-1.1-namespace+))
(is (string= "http://www.w3.org/2003/05/soap-envelope"
- cl-soap:+soap-1.2-namespace+)))
+ io.github.cl-sdk.soap:+soap-1.2-namespace+)))
;;; Structure construction
(test soap-envelope-struct
"soap-envelope struct can be constructed and its fields read back."
- (let* ((body (cl-soap:make-soap-body :payload '()))
- (env (cl-soap:make-soap-envelope :version :1.1 :body body)))
- (is (cl-soap:soap-envelope-p env))
- (is (eq :1.1 (cl-soap:soap-envelope-version env)))
- (is (null (cl-soap:soap-envelope-header env)))
- (is (cl-soap:soap-body-p (cl-soap:soap-envelope-body env)))))
+ (let* ((body (io.github.cl-sdk.soap:make-soap-body :payload '()))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.1 :body body)))
+ (is (io.github.cl-sdk.soap:soap-envelope-p env))
+ (is (eq :1.1 (io.github.cl-sdk.soap:soap-envelope-version env)))
+ (is (null (io.github.cl-sdk.soap:soap-envelope-header env)))
+ (is (io.github.cl-sdk.soap:soap-body-p (io.github.cl-sdk.soap:soap-envelope-body env)))))
(test soap-header-struct
"soap-header struct stores entries correctly."
- (let ((hdr (cl-soap:make-soap-header :entries '())))
- (is (cl-soap:soap-header-p hdr))
- (is (null (cl-soap:soap-header-entries hdr)))))
+ (let ((hdr (io.github.cl-sdk.soap:make-soap-header :entries '())))
+ (is (io.github.cl-sdk.soap:soap-header-p hdr))
+ (is (null (io.github.cl-sdk.soap:soap-header-entries hdr)))))
(test soap-body-struct
"soap-body struct stores payload correctly."
- (let ((body (cl-soap:make-soap-body :payload '())))
- (is (cl-soap:soap-body-p body))
- (is (null (cl-soap:soap-body-fault body)))
- (is (null (cl-soap:soap-body-payload body)))))
+ (let ((body (io.github.cl-sdk.soap:make-soap-body :payload '())))
+ (is (io.github.cl-sdk.soap:soap-body-p body))
+ (is (null (io.github.cl-sdk.soap:soap-body-fault body)))
+ (is (null (io.github.cl-sdk.soap:soap-body-payload body)))))
(test soap-fault-struct
"soap-fault struct stores all fields correctly."
- (let ((f (cl-soap:make-soap-fault
+ (let ((f (io.github.cl-sdk.soap:make-soap-fault
:code "soap:Client"
:string "Bad request"
:actor "http://example.com/"
:detail nil)))
- (is (cl-soap:soap-fault-p f))
- (is (string= "soap:Client" (cl-soap:soap-fault-code f)))
- (is (string= "Bad request" (cl-soap:soap-fault-string f)))
- (is (string= "http://example.com/" (cl-soap:soap-fault-actor f)))
- (is (null (cl-soap:soap-fault-detail f)))))
+ (is (io.github.cl-sdk.soap:soap-fault-p f))
+ (is (string= "soap:Client" (io.github.cl-sdk.soap:soap-fault-code f)))
+ (is (string= "Bad request" (io.github.cl-sdk.soap:soap-fault-string f)))
+ (is (string= "http://example.com/" (io.github.cl-sdk.soap:soap-fault-actor f)))
+ (is (null (io.github.cl-sdk.soap:soap-fault-detail f)))))
;;; parse-soap — SOAP 1.1
@@ -65,23 +65,23 @@
(test parse-soap-1.1-basic
"parse-soap returns a soap-envelope with version :1.1 for a SOAP 1.1 message."
- (let ((env (cl-soap:parse-soap +soap-1.1-minimal+)))
- (is (cl-soap:soap-envelope-p env))
- (is (eq :1.1 (cl-soap:soap-envelope-version env)))
- (is (null (cl-soap:soap-envelope-header env)))
- (is (cl-soap:soap-body-p (cl-soap:soap-envelope-body env)))
- (is (null (cl-soap:soap-body-fault (cl-soap:soap-envelope-body env))))
- (is (= 1 (length (cl-soap:soap-body-payload
- (cl-soap:soap-envelope-body env)))))))
+ (let ((env (io.github.cl-sdk.soap:parse-soap +soap-1.1-minimal+)))
+ (is (io.github.cl-sdk.soap:soap-envelope-p env))
+ (is (eq :1.1 (io.github.cl-sdk.soap:soap-envelope-version env)))
+ (is (null (io.github.cl-sdk.soap:soap-envelope-header env)))
+ (is (io.github.cl-sdk.soap:soap-body-p (io.github.cl-sdk.soap:soap-envelope-body env)))
+ (is (null (io.github.cl-sdk.soap:soap-body-fault (io.github.cl-sdk.soap:soap-envelope-body env))))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-body-payload
+ (io.github.cl-sdk.soap:soap-envelope-body env)))))))
(test parse-soap-1.1-body-element-name
"The body payload element is the GetPrice element."
- (let* ((env (cl-soap:parse-soap +soap-1.1-minimal+))
- (body (cl-soap:soap-envelope-body env))
- (elem (first (cl-soap:soap-body-payload body)))
- (tag (cl-xml:xml-node-tag elem)))
- (is (cl-xml:xml-qname-p tag))
- (is (string= "GetPrice" (cl-xml:xml-qname-local-name tag)))))
+ (let* ((env (io.github.cl-sdk.soap:parse-soap +soap-1.1-minimal+))
+ (body (io.github.cl-sdk.soap:soap-envelope-body env))
+ (elem (first (io.github.cl-sdk.soap:soap-body-payload body)))
+ (tag (io.github.cl-sdk.xml:xml-node-tag elem)))
+ (is (io.github.cl-sdk.xml:xml-qname-p tag))
+ (is (string= "GetPrice" (io.github.cl-sdk.xml:xml-qname-local-name tag)))))
;;; parse-soap — SOAP 1.2
@@ -95,12 +95,12 @@
(test parse-soap-1.2-basic
"parse-soap returns a soap-envelope with version :1.2 for a SOAP 1.2 message."
- (let ((env (cl-soap:parse-soap +soap-1.2-minimal+)))
- (is (cl-soap:soap-envelope-p env))
- (is (eq :1.2 (cl-soap:soap-envelope-version env)))
- (is (null (cl-soap:soap-envelope-header env)))
- (is (= 1 (length (cl-soap:soap-body-payload
- (cl-soap:soap-envelope-body env)))))))
+ (let ((env (io.github.cl-sdk.soap:parse-soap +soap-1.2-minimal+)))
+ (is (io.github.cl-sdk.soap:soap-envelope-p env))
+ (is (eq :1.2 (io.github.cl-sdk.soap:soap-envelope-version env)))
+ (is (null (io.github.cl-sdk.soap:soap-envelope-header env)))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-body-payload
+ (io.github.cl-sdk.soap:soap-envelope-body env)))))))
;;; parse-soap — Header
@@ -117,14 +117,14 @@
(test parse-soap-with-header
"parse-soap populates soap-header with the header block elements."
- (let* ((env (cl-soap:parse-soap +soap-1.1-with-header+))
- (hdr (cl-soap:soap-envelope-header env)))
- (is (cl-soap:soap-header-p hdr))
- (is (= 1 (length (cl-soap:soap-header-entries hdr))))
- (let* ((entry (first (cl-soap:soap-header-entries hdr)))
- (tag (cl-xml:xml-node-tag entry)))
- (is (cl-xml:xml-qname-p tag))
- (is (string= "Auth" (cl-xml:xml-qname-local-name tag))))))
+ (let* ((env (io.github.cl-sdk.soap:parse-soap +soap-1.1-with-header+))
+ (hdr (io.github.cl-sdk.soap:soap-envelope-header env)))
+ (is (io.github.cl-sdk.soap:soap-header-p hdr))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-header-entries hdr))))
+ (let* ((entry (first (io.github.cl-sdk.soap:soap-header-entries hdr)))
+ (tag (io.github.cl-sdk.xml:xml-node-tag entry)))
+ (is (io.github.cl-sdk.xml:xml-qname-p tag))
+ (is (string= "Auth" (io.github.cl-sdk.xml:xml-qname-local-name tag))))))
;;; parse-soap — SOAP 1.1 Fault
@@ -143,43 +143,43 @@
(test parse-soap-1.1-fault-detected
"parse-soap sets soap-body-fault for a SOAP 1.1 Fault body."
- (let* ((env (cl-soap:parse-soap +soap-1.1-fault+))
- (body (cl-soap:soap-envelope-body env))
- (fault (cl-soap:soap-body-fault body)))
- (is (cl-soap:soap-fault-p fault))
- (is (null (cl-soap:soap-body-payload body)))))
+ (let* ((env (io.github.cl-sdk.soap:parse-soap +soap-1.1-fault+))
+ (body (io.github.cl-sdk.soap:soap-envelope-body env))
+ (fault (io.github.cl-sdk.soap:soap-body-fault body)))
+ (is (io.github.cl-sdk.soap:soap-fault-p fault))
+ (is (null (io.github.cl-sdk.soap:soap-body-payload body)))))
(test parse-soap-1.1-fault-code
"SOAP 1.1 fault code is extracted from faultcode text."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.1-fault+)))))
- (is (string= "soap:Client" (cl-soap:soap-fault-code fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.1-fault+)))))
+ (is (string= "soap:Client" (io.github.cl-sdk.soap:soap-fault-code fault)))))
(test parse-soap-1.1-fault-string
"SOAP 1.1 fault string is extracted from faultstring text."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.1-fault+)))))
- (is (string= "Invalid input" (cl-soap:soap-fault-string fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.1-fault+)))))
+ (is (string= "Invalid input" (io.github.cl-sdk.soap:soap-fault-string fault)))))
(test parse-soap-1.1-fault-actor
"SOAP 1.1 fault actor is extracted from faultactor text."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.1-fault+)))))
- (is (string= "http://example.com/service" (cl-soap:soap-fault-actor fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.1-fault+)))))
+ (is (string= "http://example.com/service" (io.github.cl-sdk.soap:soap-fault-actor fault)))))
(test parse-soap-1.1-fault-detail-present
"SOAP 1.1 fault detail is the detail xml-node."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.1-fault+)))))
- (is (cl-xml:xml-node-p (cl-soap:soap-fault-detail fault)))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.1-fault+)))))
+ (is (io.github.cl-sdk.xml:xml-node-p (io.github.cl-sdk.soap:soap-fault-detail fault)))
(is (string= "detail"
- (let ((tag (cl-xml:xml-node-tag (cl-soap:soap-fault-detail fault))))
- (if (cl-xml:xml-qname-p tag)
- (cl-xml:xml-qname-local-name tag)
+ (let ((tag (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.soap:soap-fault-detail fault))))
+ (if (io.github.cl-sdk.xml:xml-qname-p tag)
+ (io.github.cl-sdk.xml:xml-qname-local-name tag)
tag))))))
;;; parse-soap — SOAP 1.2 Fault
@@ -199,211 +199,211 @@
(test parse-soap-1.2-fault-code
"SOAP 1.2 fault code is extracted from Code/Value text."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.2-fault+)))))
- (is (cl-soap:soap-fault-p fault))
- (is (string= "env:Sender" (cl-soap:soap-fault-code fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.2-fault+)))))
+ (is (io.github.cl-sdk.soap:soap-fault-p fault))
+ (is (string= "env:Sender" (io.github.cl-sdk.soap:soap-fault-code fault)))))
(test parse-soap-1.2-fault-string
"SOAP 1.2 fault string is extracted from Reason/Text text."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.2-fault+)))))
- (is (string= "Bad request" (cl-soap:soap-fault-string fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.2-fault+)))))
+ (is (string= "Bad request" (io.github.cl-sdk.soap:soap-fault-string fault)))))
(test parse-soap-1.2-fault-actor
"SOAP 1.2 Role is mapped to soap-fault-actor."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.2-fault+)))))
- (is (string= "http://example.com/node" (cl-soap:soap-fault-actor fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.2-fault+)))))
+ (is (string= "http://example.com/node" (io.github.cl-sdk.soap:soap-fault-actor fault)))))
(test parse-soap-1.2-fault-detail-present
"SOAP 1.2 fault Detail is the Detail xml-node."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.2-fault+)))))
- (is (cl-xml:xml-node-p (cl-soap:soap-fault-detail fault)))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.2-fault+)))))
+ (is (io.github.cl-sdk.xml:xml-node-p (io.github.cl-sdk.soap:soap-fault-detail fault)))
(is (string= "Detail"
- (let ((tag (cl-xml:xml-node-tag (cl-soap:soap-fault-detail fault))))
- (if (cl-xml:xml-qname-p tag)
- (cl-xml:xml-qname-local-name tag)
+ (let ((tag (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.soap:soap-fault-detail fault))))
+ (if (io.github.cl-sdk.xml:xml-qname-p tag)
+ (io.github.cl-sdk.xml:xml-qname-local-name tag)
tag))))))
(test parse-soap-1.2-fault-lang
"SOAP 1.2 fault lang is extracted from Reason/Text xml:lang attribute."
- (let* ((fault (cl-soap:soap-body-fault
- (cl-soap:soap-envelope-body
- (cl-soap:parse-soap +soap-1.2-fault+)))))
- (is (string= "en" (cl-soap:soap-fault-lang fault)))))
+ (let* ((fault (io.github.cl-sdk.soap:soap-body-fault
+ (io.github.cl-sdk.soap:soap-envelope-body
+ (io.github.cl-sdk.soap:parse-soap +soap-1.2-fault+)))))
+ (is (string= "en" (io.github.cl-sdk.soap:soap-fault-lang fault)))))
;;; parse-soap — error cases
(test parse-soap-not-envelope-error
"parse-soap signals soap-error when root element is not Envelope."
- (signals cl-soap:soap-error
- (cl-soap:parse-soap
+ (signals io.github.cl-sdk.soap:soap-error
+ (io.github.cl-sdk.soap:parse-soap
"")))
(test parse-soap-unknown-namespace-error
"parse-soap signals soap-error for an unknown SOAP namespace URI."
- (signals cl-soap:soap-error
- (cl-soap:parse-soap
+ (signals io.github.cl-sdk.soap:soap-error
+ (io.github.cl-sdk.soap:parse-soap
"")))
(test parse-soap-no-body-error
"parse-soap signals soap-error when the Envelope has no Body."
- (signals cl-soap:soap-error
- (cl-soap:parse-soap
+ (signals io.github.cl-sdk.soap:soap-error
+ (io.github.cl-sdk.soap:parse-soap
"")))
;;; serialize-soap
(defun parse-soap-from-string (str)
"Round-trip helper: parse STR as a SOAP envelope."
- (cl-soap:parse-soap str))
+ (io.github.cl-sdk.soap:parse-soap str))
(test serialize-soap-returns-string
"serialize-soap returns a non-empty string by default."
- (let* ((body (cl-soap:make-soap-body :payload '()))
- (env (cl-soap:make-soap-envelope :version :1.1 :body body))
- (xml (cl-soap:serialize-soap env)))
+ (let* ((body (io.github.cl-sdk.soap:make-soap-body :payload '()))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.1 :body body))
+ (xml (io.github.cl-sdk.soap:serialize-soap env)))
(is (stringp xml))
(is (plusp (length xml)))))
(test serialize-soap-contains-envelope-tag
"The serialized string contains soap:Envelope."
- (let* ((body (cl-soap:make-soap-body :payload '()))
- (env (cl-soap:make-soap-envelope :version :1.1 :body body))
- (xml (cl-soap:serialize-soap env)))
+ (let* ((body (io.github.cl-sdk.soap:make-soap-body :payload '()))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.1 :body body))
+ (xml (io.github.cl-sdk.soap:serialize-soap env)))
(is (search "Envelope" xml))))
(test serialize-soap-1.1-namespace-present
"Serialized SOAP 1.1 output contains the SOAP 1.1 namespace URI."
- (let* ((body (cl-soap:make-soap-body :payload '()))
- (env (cl-soap:make-soap-envelope :version :1.1 :body body))
- (xml (cl-soap:serialize-soap env)))
+ (let* ((body (io.github.cl-sdk.soap:make-soap-body :payload '()))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.1 :body body))
+ (xml (io.github.cl-sdk.soap:serialize-soap env)))
(is (search "schemas.xmlsoap.org/soap/envelope/" xml))))
(test serialize-soap-1.2-namespace-present
"Serialized SOAP 1.2 output contains the SOAP 1.2 namespace URI."
- (let* ((body (cl-soap:make-soap-body :payload '()))
- (env (cl-soap:make-soap-envelope :version :1.2 :body body))
- (xml (cl-soap:serialize-soap env)))
+ (let* ((body (io.github.cl-sdk.soap:make-soap-body :payload '()))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.2 :body body))
+ (xml (io.github.cl-sdk.soap:serialize-soap env)))
(is (search "w3.org/2003/05/soap-envelope" xml))))
(test serialize-soap-to-stream
"serialize-soap writes to a supplied stream and returns nil."
- (let* ((body (cl-soap:make-soap-body :payload '()))
- (env (cl-soap:make-soap-envelope :version :1.1 :body body))
+ (let* ((body (io.github.cl-sdk.soap:make-soap-body :payload '()))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.1 :body body))
result)
(with-output-to-string (s)
- (setf result (cl-soap:serialize-soap env :stream s)))
+ (setf result (io.github.cl-sdk.soap:serialize-soap env :stream s)))
(is (null result))))
(test serialize-soap-roundtrip-1.1
"Serializing and re-parsing a SOAP 1.1 envelope preserves version and body."
- (let* ((env (cl-soap:parse-soap +soap-1.1-minimal+))
- (xml (cl-soap:serialize-soap env))
- (env2 (cl-soap:parse-soap xml)))
- (is (eq :1.1 (cl-soap:soap-envelope-version env2)))
- (is (= 1 (length (cl-soap:soap-body-payload
- (cl-soap:soap-envelope-body env2)))))))
+ (let* ((env (io.github.cl-sdk.soap:parse-soap +soap-1.1-minimal+))
+ (xml (io.github.cl-sdk.soap:serialize-soap env))
+ (env2 (io.github.cl-sdk.soap:parse-soap xml)))
+ (is (eq :1.1 (io.github.cl-sdk.soap:soap-envelope-version env2)))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-body-payload
+ (io.github.cl-sdk.soap:soap-envelope-body env2)))))))
(test serialize-soap-roundtrip-1.2
"Serializing and re-parsing a SOAP 1.2 envelope preserves version."
- (let* ((env (cl-soap:parse-soap +soap-1.2-minimal+))
- (xml (cl-soap:serialize-soap env))
- (env2 (cl-soap:parse-soap xml)))
- (is (eq :1.2 (cl-soap:soap-envelope-version env2)))))
+ (let* ((env (io.github.cl-sdk.soap:parse-soap +soap-1.2-minimal+))
+ (xml (io.github.cl-sdk.soap:serialize-soap env))
+ (env2 (io.github.cl-sdk.soap:parse-soap xml)))
+ (is (eq :1.2 (io.github.cl-sdk.soap:soap-envelope-version env2)))))
(test serialize-soap-roundtrip-header
"Serializing and re-parsing preserves the header block count."
- (let* ((env (cl-soap:parse-soap +soap-1.1-with-header+))
- (xml (cl-soap:serialize-soap env))
- (env2 (cl-soap:parse-soap xml))
- (hdr (cl-soap:soap-envelope-header env2)))
- (is (cl-soap:soap-header-p hdr))
- (is (= 1 (length (cl-soap:soap-header-entries hdr))))))
+ (let* ((env (io.github.cl-sdk.soap:parse-soap +soap-1.1-with-header+))
+ (xml (io.github.cl-sdk.soap:serialize-soap env))
+ (env2 (io.github.cl-sdk.soap:parse-soap xml))
+ (hdr (io.github.cl-sdk.soap:soap-envelope-header env2)))
+ (is (io.github.cl-sdk.soap:soap-header-p hdr))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-header-entries hdr))))))
(test serialize-soap-1.1-fault-roundtrip
"Serializing and re-parsing a SOAP 1.1 fault preserves code and string."
- (let* ((fault-in (cl-soap:make-soap-fault
+ (let* ((fault-in (io.github.cl-sdk.soap:make-soap-fault
:code "soap:Server" :string "Internal error"))
- (body (cl-soap:make-soap-body :fault fault-in))
- (env (cl-soap:make-soap-envelope :version :1.1 :body body))
- (xml (cl-soap:serialize-soap env))
- (env2 (cl-soap:parse-soap xml))
- (fault (cl-soap:soap-body-fault (cl-soap:soap-envelope-body env2))))
- (is (cl-soap:soap-fault-p fault))
- (is (string= "soap:Server" (cl-soap:soap-fault-code fault)))
- (is (string= "Internal error" (cl-soap:soap-fault-string fault)))))
+ (body (io.github.cl-sdk.soap:make-soap-body :fault fault-in))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.1 :body body))
+ (xml (io.github.cl-sdk.soap:serialize-soap env))
+ (env2 (io.github.cl-sdk.soap:parse-soap xml))
+ (fault (io.github.cl-sdk.soap:soap-body-fault (io.github.cl-sdk.soap:soap-envelope-body env2))))
+ (is (io.github.cl-sdk.soap:soap-fault-p fault))
+ (is (string= "soap:Server" (io.github.cl-sdk.soap:soap-fault-code fault)))
+ (is (string= "Internal error" (io.github.cl-sdk.soap:soap-fault-string fault)))))
(test serialize-soap-1.2-fault-roundtrip
"Serializing and re-parsing a SOAP 1.2 fault preserves code and string."
- (let* ((fault-in (cl-soap:make-soap-fault
+ (let* ((fault-in (io.github.cl-sdk.soap:make-soap-fault
:code "env:Receiver" :string "Processing failed"))
- (body (cl-soap:make-soap-body :fault fault-in))
- (env (cl-soap:make-soap-envelope :version :1.2 :body body))
- (xml (cl-soap:serialize-soap env))
- (env2 (cl-soap:parse-soap xml))
- (fault (cl-soap:soap-body-fault (cl-soap:soap-envelope-body env2))))
- (is (cl-soap:soap-fault-p fault))
- (is (string= "env:Receiver" (cl-soap:soap-fault-code fault)))
- (is (string= "Processing failed" (cl-soap:soap-fault-string fault)))))
+ (body (io.github.cl-sdk.soap:make-soap-body :fault fault-in))
+ (env (io.github.cl-sdk.soap:make-soap-envelope :version :1.2 :body body))
+ (xml (io.github.cl-sdk.soap:serialize-soap env))
+ (env2 (io.github.cl-sdk.soap:parse-soap xml))
+ (fault (io.github.cl-sdk.soap:soap-body-fault (io.github.cl-sdk.soap:soap-envelope-body env2))))
+ (is (io.github.cl-sdk.soap:soap-fault-p fault))
+ (is (string= "env:Receiver" (io.github.cl-sdk.soap:soap-fault-code fault)))
+ (is (string= "Processing failed" (io.github.cl-sdk.soap:soap-fault-string fault)))))
;;; soap-make-envelope
(test soap-make-envelope-basic
"soap-make-envelope wraps body XML in a SOAP 1.1 envelope."
- (let* ((env (cl-soap:soap-make-envelope
+ (let* ((env (io.github.cl-sdk.soap:soap-make-envelope
"1"))
- (body (cl-soap:soap-envelope-body env)))
- (is (cl-soap:soap-envelope-p env))
- (is (eq :1.1 (cl-soap:soap-envelope-version env)))
- (is (null (cl-soap:soap-envelope-header env)))
- (is (= 1 (length (cl-soap:soap-body-payload body))))
+ (body (io.github.cl-sdk.soap:soap-envelope-body env)))
+ (is (io.github.cl-sdk.soap:soap-envelope-p env))
+ (is (eq :1.1 (io.github.cl-sdk.soap:soap-envelope-version env)))
+ (is (null (io.github.cl-sdk.soap:soap-envelope-header env)))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-body-payload body))))
(is (string= "GetUser"
- (cl-xml:xml-qname-local-name
- (cl-xml:xml-node-tag
- (first (cl-soap:soap-body-payload body))))))))
+ (io.github.cl-sdk.xml:xml-qname-local-name
+ (io.github.cl-sdk.xml:xml-node-tag
+ (first (io.github.cl-sdk.soap:soap-body-payload body))))))))
(test soap-make-envelope-version-1.2
"soap-make-envelope respects the :version :1.2 keyword argument."
- (let ((env (cl-soap:soap-make-envelope
+ (let ((env (io.github.cl-sdk.soap:soap-make-envelope
"" :version :1.2)))
- (is (eq :1.2 (cl-soap:soap-envelope-version env)))))
+ (is (eq :1.2 (io.github.cl-sdk.soap:soap-envelope-version env)))))
(test soap-make-envelope-with-header
"soap-make-envelope with :header-xml adds header entries."
- (let* ((env (cl-soap:soap-make-envelope
+ (let* ((env (io.github.cl-sdk.soap:soap-make-envelope
""
:header-xml "xyz"))
- (hdr (cl-soap:soap-envelope-header env)))
- (is (cl-soap:soap-header-p hdr))
- (is (= 1 (length (cl-soap:soap-header-entries hdr))))
- (let ((tag (cl-xml:xml-node-tag (first (cl-soap:soap-header-entries hdr)))))
+ (hdr (io.github.cl-sdk.soap:soap-envelope-header env)))
+ (is (io.github.cl-sdk.soap:soap-header-p hdr))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-header-entries hdr))))
+ (let ((tag (io.github.cl-sdk.xml:xml-node-tag (first (io.github.cl-sdk.soap:soap-header-entries hdr)))))
(is (string= "auth"
- (if (cl-xml:xml-qname-p tag)
- (cl-xml:xml-qname-local-name tag)
+ (if (io.github.cl-sdk.xml:xml-qname-p tag)
+ (io.github.cl-sdk.xml:xml-qname-local-name tag)
tag))))))
(test soap-make-envelope-serialize-roundtrip
"An envelope built with soap-make-envelope survives a serialize/parse round-trip."
- (let* ((env (cl-soap:soap-make-envelope
+ (let* ((env (io.github.cl-sdk.soap:soap-make-envelope
"" :version :1.1))
- (xml (cl-soap:serialize-soap env))
- (env2 (cl-soap:parse-soap xml)))
- (is (eq :1.1 (cl-soap:soap-envelope-version env2)))
- (is (= 1 (length (cl-soap:soap-body-payload
- (cl-soap:soap-envelope-body env2)))))))
+ (xml (io.github.cl-sdk.soap:serialize-soap env))
+ (env2 (io.github.cl-sdk.soap:parse-soap xml)))
+ (is (eq :1.1 (io.github.cl-sdk.soap:soap-envelope-version env2)))
+ (is (= 1 (length (io.github.cl-sdk.soap:soap-body-payload
+ (io.github.cl-sdk.soap:soap-envelope-body env2)))))))
(test soap-error-condition
"soap-error condition reports message correctly."
- (let ((err (make-condition 'cl-soap:soap-error :message "test error")))
- (is (string= "test error" (cl-soap:soap-error-message err)))
- (is (null (cl-soap:soap-error-path err)))
+ (let ((err (make-condition 'io.github.cl-sdk.soap:soap-error :message "test error")))
+ (is (string= "test error" (io.github.cl-sdk.soap:soap-error-message err)))
+ (is (null (io.github.cl-sdk.soap:soap-error-path err)))
(is (search "test error" (format nil "~a" err)))))
diff --git a/t/cl-wsdl-package.lisp b/t/cl-wsdl-package.lisp
index df588d3..492d66f 100644
--- a/t/cl-wsdl-package.lisp
+++ b/t/cl-wsdl-package.lisp
@@ -1,3 +1,3 @@
-(defpackage #:cl-wsdl.test
- (:use #:cl #:fiveam #:cl-wsdl)
+(defpackage #:io.github.cl-sdk.wsdl.test
+ (:use #:cl #:fiveam #:io.github.cl-sdk.wsdl)
(:export #:cl-wsdl-suite))
diff --git a/t/cl-wsdl-tests.lisp b/t/cl-wsdl-tests.lisp
index cbb6863..e87dceb 100644
--- a/t/cl-wsdl-tests.lisp
+++ b/t/cl-wsdl-tests.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-wsdl.test)
+(in-package #:io.github.cl-sdk.wsdl.test)
(def-suite cl-wsdl-suite
:description "Test suite for cl-wsdl.")
@@ -35,92 +35,92 @@
(test wsdl-namespace-constant
"The WSDL 2.0 namespace URI constant has the correct value."
(is (string= "http://www.w3.org/ns/wsdl"
- cl-wsdl:+wsdl-2.0-namespace+)))
+ io.github.cl-sdk.wsdl:+wsdl-2.0-namespace+)))
(test parse-wsdl-returns-description
"parse-wsdl returns a wsdl-description struct."
- (let ((desc (cl-wsdl:parse-wsdl +simple-wsdl+)))
- (is (cl-wsdl:wsdl-description-p desc))))
+ (let ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+)))
+ (is (io.github.cl-sdk.wsdl:wsdl-description-p desc))))
(test parse-wsdl-target-namespace
"parse-wsdl captures the targetNamespace attribute."
- (let ((desc (cl-wsdl:parse-wsdl +simple-wsdl+)))
+ (let ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+)))
(is (string= "http://example.com/hello"
- (cl-wsdl:wsdl-description-target-namespace desc)))))
+ (io.github.cl-sdk.wsdl:wsdl-description-target-namespace desc)))))
(test parse-wsdl-interface-count
"parse-wsdl populates the interfaces list."
- (let ((desc (cl-wsdl:parse-wsdl +simple-wsdl+)))
- (is (= 1 (length (cl-wsdl:wsdl-description-interfaces desc))))))
+ (let ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+)))
+ (is (= 1 (length (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc))))))
(test parse-wsdl-interface-name
"parse-wsdl captures the interface name."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (iface (first (cl-wsdl:wsdl-description-interfaces desc))))
- (is (cl-wsdl:wsdl-interface-p iface))
- (is (string= "HelloInterface" (cl-wsdl:wsdl-interface-name iface)))))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (iface (first (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc))))
+ (is (io.github.cl-sdk.wsdl:wsdl-interface-p iface))
+ (is (string= "HelloInterface" (io.github.cl-sdk.wsdl:wsdl-interface-name iface)))))
(test parse-wsdl-interface-operation
"parse-wsdl parses wsdl:operation inside wsdl:interface."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (iface (first (cl-wsdl:wsdl-description-interfaces desc)))
- (op (first (cl-wsdl:wsdl-interface-operations iface))))
- (is (cl-wsdl:wsdl-interface-operation-p op))
- (is (string= "sayHello" (cl-wsdl:wsdl-interface-operation-name op)))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (iface (first (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc)))
+ (op (first (io.github.cl-sdk.wsdl:wsdl-interface-operations iface))))
+ (is (io.github.cl-sdk.wsdl:wsdl-interface-operation-p op))
+ (is (string= "sayHello" (io.github.cl-sdk.wsdl:wsdl-interface-operation-name op)))
(is (string= "http://www.w3.org/ns/wsdl/in-out"
- (cl-wsdl:wsdl-interface-operation-pattern op)))))
+ (io.github.cl-sdk.wsdl:wsdl-interface-operation-pattern op)))))
(test parse-wsdl-operation-input-output
"parse-wsdl records wsdl:input and wsdl:output as wsdl-message-ref structs."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (op (first (cl-wsdl:wsdl-interface-operations
- (first (cl-wsdl:wsdl-description-interfaces desc)))))
- (in (first (cl-wsdl:wsdl-interface-operation-inputs op)))
- (out (first (cl-wsdl:wsdl-interface-operation-outputs op))))
- (is (cl-wsdl:wsdl-message-ref-p in))
- (is (string= "tns:SayHelloRequest" (cl-wsdl:wsdl-message-ref-element in)))
- (is (cl-wsdl:wsdl-message-ref-p out))
- (is (string= "tns:SayHelloResponse" (cl-wsdl:wsdl-message-ref-element out)))))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (op (first (io.github.cl-sdk.wsdl:wsdl-interface-operations
+ (first (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc)))))
+ (in (first (io.github.cl-sdk.wsdl:wsdl-interface-operation-inputs op)))
+ (out (first (io.github.cl-sdk.wsdl:wsdl-interface-operation-outputs op))))
+ (is (io.github.cl-sdk.wsdl:wsdl-message-ref-p in))
+ (is (string= "tns:SayHelloRequest" (io.github.cl-sdk.wsdl:wsdl-message-ref-element in)))
+ (is (io.github.cl-sdk.wsdl:wsdl-message-ref-p out))
+ (is (string= "tns:SayHelloResponse" (io.github.cl-sdk.wsdl:wsdl-message-ref-element out)))))
(test parse-wsdl-binding
"parse-wsdl parses wsdl:binding with name, interface, and type."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (binding (first (cl-wsdl:wsdl-description-bindings desc))))
- (is (cl-wsdl:wsdl-binding-p binding))
- (is (string= "HelloBinding" (cl-wsdl:wsdl-binding-name binding)))
- (is (string= "tns:HelloInterface" (cl-wsdl:wsdl-binding-interface binding)))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (binding (first (io.github.cl-sdk.wsdl:wsdl-description-bindings desc))))
+ (is (io.github.cl-sdk.wsdl:wsdl-binding-p binding))
+ (is (string= "HelloBinding" (io.github.cl-sdk.wsdl:wsdl-binding-name binding)))
+ (is (string= "tns:HelloInterface" (io.github.cl-sdk.wsdl:wsdl-binding-interface binding)))
(is (string= "http://www.w3.org/ns/wsdl/soap"
- (cl-wsdl:wsdl-binding-type binding)))))
+ (io.github.cl-sdk.wsdl:wsdl-binding-type binding)))))
(test parse-wsdl-binding-operation
"parse-wsdl parses wsdl:operation inside wsdl:binding."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (binding (first (cl-wsdl:wsdl-description-bindings desc)))
- (bop (first (cl-wsdl:wsdl-binding-operations binding))))
- (is (cl-wsdl:wsdl-binding-operation-p bop))
- (is (string= "tns:sayHello" (cl-wsdl:wsdl-binding-operation-ref bop)))))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (binding (first (io.github.cl-sdk.wsdl:wsdl-description-bindings desc)))
+ (bop (first (io.github.cl-sdk.wsdl:wsdl-binding-operations binding))))
+ (is (io.github.cl-sdk.wsdl:wsdl-binding-operation-p bop))
+ (is (string= "tns:sayHello" (io.github.cl-sdk.wsdl:wsdl-binding-operation-ref bop)))))
(test parse-wsdl-service
"parse-wsdl parses wsdl:service."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (service (first (cl-wsdl:wsdl-description-services desc))))
- (is (cl-wsdl:wsdl-service-p service))
- (is (string= "HelloService" (cl-wsdl:wsdl-service-name service)))
- (is (string= "tns:HelloInterface" (cl-wsdl:wsdl-service-interface service)))))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (service (first (io.github.cl-sdk.wsdl:wsdl-description-services desc))))
+ (is (io.github.cl-sdk.wsdl:wsdl-service-p service))
+ (is (string= "HelloService" (io.github.cl-sdk.wsdl:wsdl-service-name service)))
+ (is (string= "tns:HelloInterface" (io.github.cl-sdk.wsdl:wsdl-service-interface service)))))
(test parse-wsdl-endpoint
"parse-wsdl parses wsdl:endpoint inside wsdl:service."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (service (first (cl-wsdl:wsdl-description-services desc)))
- (ep (first (cl-wsdl:wsdl-service-endpoints service))))
- (is (cl-wsdl:wsdl-endpoint-p ep))
- (is (string= "HelloEndpoint" (cl-wsdl:wsdl-endpoint-name ep)))
- (is (string= "tns:HelloBinding" (cl-wsdl:wsdl-endpoint-binding ep)))
- (is (string= "http://example.com/hello" (cl-wsdl:wsdl-endpoint-address ep)))))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (service (first (io.github.cl-sdk.wsdl:wsdl-description-services desc)))
+ (ep (first (io.github.cl-sdk.wsdl:wsdl-service-endpoints service))))
+ (is (io.github.cl-sdk.wsdl:wsdl-endpoint-p ep))
+ (is (string= "HelloEndpoint" (io.github.cl-sdk.wsdl:wsdl-endpoint-name ep)))
+ (is (string= "tns:HelloBinding" (io.github.cl-sdk.wsdl:wsdl-endpoint-binding ep)))
+ (is (string= "http://example.com/hello" (io.github.cl-sdk.wsdl:wsdl-endpoint-address ep)))))
(test parse-wsdl-interface-fault
"parse-wsdl parses wsdl:fault inside wsdl:interface."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
@@ -128,15 +128,15 @@
"))
- (iface (first (cl-wsdl:wsdl-description-interfaces desc)))
- (fault (first (cl-wsdl:wsdl-interface-faults iface))))
- (is (cl-wsdl:wsdl-interface-fault-p fault))
- (is (string= "NotFound" (cl-wsdl:wsdl-interface-fault-name fault)))
- (is (string= "tns:NotFoundFault" (cl-wsdl:wsdl-interface-fault-element fault)))))
+ (iface (first (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc)))
+ (fault (first (io.github.cl-sdk.wsdl:wsdl-interface-faults iface))))
+ (is (io.github.cl-sdk.wsdl:wsdl-interface-fault-p fault))
+ (is (string= "NotFound" (io.github.cl-sdk.wsdl:wsdl-interface-fault-name fault)))
+ (is (string= "tns:NotFoundFault" (io.github.cl-sdk.wsdl:wsdl-interface-fault-element fault)))))
(test parse-wsdl-infault-outfault
"parse-wsdl parses wsdl:infault and wsdl:outfault inside wsdl:operation."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
@@ -150,56 +150,56 @@
"))
- (op (first (cl-wsdl:wsdl-interface-operations
- (first (cl-wsdl:wsdl-description-interfaces desc))))))
- (let ((inf (first (cl-wsdl:wsdl-interface-operation-in-faults op)))
- (outf (first (cl-wsdl:wsdl-interface-operation-out-faults op))))
- (is (cl-wsdl:wsdl-fault-ref-p inf))
- (is (string= "tns:InputFault" (cl-wsdl:wsdl-fault-ref-ref inf)))
- (is (cl-wsdl:wsdl-fault-ref-p outf))
- (is (string= "tns:OutputFault" (cl-wsdl:wsdl-fault-ref-ref outf))))))
+ (op (first (io.github.cl-sdk.wsdl:wsdl-interface-operations
+ (first (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc))))))
+ (let ((inf (first (io.github.cl-sdk.wsdl:wsdl-interface-operation-in-faults op)))
+ (outf (first (io.github.cl-sdk.wsdl:wsdl-interface-operation-out-faults op))))
+ (is (io.github.cl-sdk.wsdl:wsdl-fault-ref-p inf))
+ (is (string= "tns:InputFault" (io.github.cl-sdk.wsdl:wsdl-fault-ref-ref inf)))
+ (is (io.github.cl-sdk.wsdl:wsdl-fault-ref-p outf))
+ (is (string= "tns:OutputFault" (io.github.cl-sdk.wsdl:wsdl-fault-ref-ref outf))))))
(test parse-wsdl-interface-extends
"parse-wsdl captures the extends attribute as a list of names."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
"))
- (iface (first (cl-wsdl:wsdl-description-interfaces desc))))
+ (iface (first (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc))))
(is (equal '("tns:Base1" "tns:Base2")
- (cl-wsdl:wsdl-interface-extends iface)))))
+ (io.github.cl-sdk.wsdl:wsdl-interface-extends iface)))))
(test parse-wsdl-import
"parse-wsdl captures wsdl:import elements."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
"))
- (imp (first (cl-wsdl:wsdl-description-imports desc))))
- (is (cl-wsdl:wsdl-import-p imp))
- (is (string= "http://other.example.com/" (cl-wsdl:wsdl-import-namespace imp)))
- (is (string= "other.wsdl" (cl-wsdl:wsdl-import-location imp)))))
+ (imp (first (io.github.cl-sdk.wsdl:wsdl-description-imports desc))))
+ (is (io.github.cl-sdk.wsdl:wsdl-import-p imp))
+ (is (string= "http://other.example.com/" (io.github.cl-sdk.wsdl:wsdl-import-namespace imp)))
+ (is (string= "other.wsdl" (io.github.cl-sdk.wsdl:wsdl-import-location imp)))))
(test parse-wsdl-include
"parse-wsdl captures wsdl:include elements."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
"))
- (inc (first (cl-wsdl:wsdl-description-includes desc))))
- (is (cl-wsdl:wsdl-include-p inc))
- (is (string= "common.wsdl" (cl-wsdl:wsdl-include-location inc)))))
+ (inc (first (io.github.cl-sdk.wsdl:wsdl-description-includes desc))))
+ (is (io.github.cl-sdk.wsdl:wsdl-include-p inc))
+ (is (string= "common.wsdl" (io.github.cl-sdk.wsdl:wsdl-include-location inc)))))
(test parse-wsdl-types-preserved
"parse-wsdl stores type children as xml-nodes."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
")))
- (is (= 1 (length (cl-wsdl:wsdl-description-types desc))))
- (is (cl-xml:xml-node-p (first (cl-wsdl:wsdl-description-types desc))))))
+ (is (= 1 (length (io.github.cl-sdk.wsdl:wsdl-description-types desc))))
+ (is (io.github.cl-sdk.xml:xml-node-p (first (io.github.cl-sdk.wsdl:wsdl-description-types desc))))))
(test parse-wsdl-binding-fault
"parse-wsdl parses wsdl:fault inside wsdl:binding."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
@@ -224,153 +224,153 @@
"))
- (bf (first (cl-wsdl:wsdl-binding-faults
- (first (cl-wsdl:wsdl-description-bindings desc))))))
- (is (cl-wsdl:wsdl-binding-fault-p bf))
- (is (string= "tns:NotFound" (cl-wsdl:wsdl-binding-fault-ref bf)))
- (is (string= "soap:Sender" (cl-wsdl:wsdl-binding-fault-code bf)))))
+ (bf (first (io.github.cl-sdk.wsdl:wsdl-binding-faults
+ (first (io.github.cl-sdk.wsdl:wsdl-description-bindings desc))))))
+ (is (io.github.cl-sdk.wsdl:wsdl-binding-fault-p bf))
+ (is (string= "tns:NotFound" (io.github.cl-sdk.wsdl:wsdl-binding-fault-ref bf)))
+ (is (string= "soap:Sender" (io.github.cl-sdk.wsdl:wsdl-binding-fault-code bf)))))
(test parse-wsdl-wrong-root-signals-error
"parse-wsdl signals wsdl-error when the root element is not wsdl:description."
- (signals cl-wsdl:wsdl-error
- (cl-wsdl:parse-wsdl
+ (signals io.github.cl-sdk.wsdl:wsdl-error
+ (io.github.cl-sdk.wsdl:parse-wsdl
"
")))
(test parse-wsdl-wrong-namespace-signals-error
"parse-wsdl signals wsdl-error when the namespace URI is not WSDL 2.0."
- (signals cl-wsdl:wsdl-error
- (cl-wsdl:parse-wsdl
+ (signals io.github.cl-sdk.wsdl:wsdl-error
+ (io.github.cl-sdk.wsdl:parse-wsdl
"
")))
(test serialize-wsdl-returns-string
"serialize-wsdl with no :stream argument returns a string."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (out (cl-wsdl:serialize-wsdl desc)))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (out (io.github.cl-sdk.wsdl:serialize-wsdl desc)))
(is (stringp out))))
(test serialize-wsdl-contains-declaration
"serialize-wsdl output starts with an XML declaration."
- (let* ((desc (cl-wsdl:parse-wsdl +simple-wsdl+))
- (out (cl-wsdl:serialize-wsdl desc)))
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl +simple-wsdl+))
+ (out (io.github.cl-sdk.wsdl:serialize-wsdl desc)))
(is (search "
")))
- (is (cl-wsdl:wsdl-description-p desc))
- (is (null (cl-wsdl:wsdl-description-target-namespace desc)))))
+ (is (io.github.cl-sdk.wsdl:wsdl-description-p desc))
+ (is (null (io.github.cl-sdk.wsdl:wsdl-description-target-namespace desc)))))
(test parse-wsdl-multiple-interfaces
"parse-wsdl collects all wsdl:interface children in order."
- (let* ((desc (cl-wsdl:parse-wsdl
+ (let* ((desc (io.github.cl-sdk.wsdl:parse-wsdl
"
@@ -378,8 +378,8 @@
"))
- (ifaces (cl-wsdl:wsdl-description-interfaces desc)))
+ (ifaces (io.github.cl-sdk.wsdl:wsdl-description-interfaces desc)))
(is (= 3 (length ifaces)))
- (is (string= "Alpha" (cl-wsdl:wsdl-interface-name (first ifaces))))
- (is (string= "Beta" (cl-wsdl:wsdl-interface-name (second ifaces))))
- (is (string= "Gamma" (cl-wsdl:wsdl-interface-name (third ifaces))))))
+ (is (string= "Alpha" (io.github.cl-sdk.wsdl:wsdl-interface-name (first ifaces))))
+ (is (string= "Beta" (io.github.cl-sdk.wsdl:wsdl-interface-name (second ifaces))))
+ (is (string= "Gamma" (io.github.cl-sdk.wsdl:wsdl-interface-name (third ifaces))))))
diff --git a/t/cl-xml-tests.lisp b/t/cl-xml-tests.lisp
index bc83227..ae2f885 100644
--- a/t/cl-xml-tests.lisp
+++ b/t/cl-xml-tests.lisp
@@ -1,4 +1,4 @@
-(in-package #:cl-xml.test)
+(in-package #:io.github.cl-sdk.xml.test)
(def-suite cl-xml-suite
:description "Test suite for cl-xml.")
@@ -9,47 +9,47 @@
(defun parse-root (str)
"Parse STR and return the root xml-node."
- (cl-xml:xml-document-root (cl-xml:parse-xml str)))
+ (io.github.cl-sdk.xml:xml-document-root (io.github.cl-sdk.xml:parse-xml str)))
;;; ── Original regression tests ────────────────────────────────────────────
(test self-closing-node
"A self-closing element is parsed into an xml-node with no children."
(let ((node (parse-root "")))
- (is (string= "tag" (cl-xml:xml-node-tag node)))
- (is (null (cl-xml:xml-node-attributes node)))
- (is (null (cl-xml:xml-node-children node)))))
+ (is (string= "tag" (io.github.cl-sdk.xml:xml-node-tag node)))
+ (is (null (io.github.cl-sdk.xml:xml-node-attributes node)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children node)))))
(test self-closing-node-with-attribute
"A self-closing element with one attribute."
(let ((node (parse-root "
")))
- (is (string= "img" (cl-xml:xml-node-tag node)))
- (is (equal '(("src" . "logo.png")) (cl-xml:xml-node-attributes node)))
- (is (null (cl-xml:xml-node-children node)))))
+ (is (string= "img" (io.github.cl-sdk.xml:xml-node-tag node)))
+ (is (equal '(("src" . "logo.png")) (io.github.cl-sdk.xml:xml-node-attributes node)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children node)))))
(test empty-element
"An element with an explicit closing tag but no children."
(let ((node (parse-root "")))
- (is (string= "div" (cl-xml:xml-node-tag node)))
- (is (null (cl-xml:xml-node-attributes node)))
- (is (null (cl-xml:xml-node-children node)))))
+ (is (string= "div" (io.github.cl-sdk.xml:xml-node-tag node)))
+ (is (null (io.github.cl-sdk.xml:xml-node-attributes node)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children node)))))
(test element-with-attribute
"An element with one attribute and an explicit closing tag."
(let ((node (parse-root "")))
- (is (string= "a" (cl-xml:xml-node-tag node)))
+ (is (string= "a" (io.github.cl-sdk.xml:xml-node-tag node)))
(is (equal '(("href" . "https://example.com"))
- (cl-xml:xml-node-attributes node)))
- (is (null (cl-xml:xml-node-children node)))))
+ (io.github.cl-sdk.xml:xml-node-attributes node)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children node)))))
(test element-with-children
"An element whose children are parsed recursively."
(let ((root (parse-root "")))
- (is (string= "root" (cl-xml:xml-node-tag root)))
- (is (= 1 (length (cl-xml:xml-node-children root))))
- (let ((child (first (cl-xml:xml-node-children root))))
- (is (string= "child" (cl-xml:xml-node-tag child)))
- (is (null (cl-xml:xml-node-children child))))))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag root)))
+ (is (= 1 (length (io.github.cl-sdk.xml:xml-node-children root))))
+ (let ((child (first (io.github.cl-sdk.xml:xml-node-children root))))
+ (is (string= "child" (io.github.cl-sdk.xml:xml-node-tag child)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children child))))))
(test problem-statement-example
"Parse the full example from the problem statement."
@@ -60,126 +60,126 @@
")
(root (parse-root xml)))
- (is (string= "root" (cl-xml:xml-node-tag root)))
- (is (null (cl-xml:xml-node-attributes root)))
- (is (= 2 (length (cl-xml:xml-node-children root))))
- (let ((self-closing (first (cl-xml:xml-node-children root)))
- (with-children (second (cl-xml:xml-node-children root))))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag root)))
+ (is (null (io.github.cl-sdk.xml:xml-node-attributes root)))
+ (is (= 2 (length (io.github.cl-sdk.xml:xml-node-children root))))
+ (let ((self-closing (first (io.github.cl-sdk.xml:xml-node-children root)))
+ (with-children (second (io.github.cl-sdk.xml:xml-node-children root))))
;; self-closing child
- (is (string= "node-without-children" (cl-xml:xml-node-tag self-closing)))
+ (is (string= "node-without-children" (io.github.cl-sdk.xml:xml-node-tag self-closing)))
(is (equal '(("attribute-name" . "attribute-value"))
- (cl-xml:xml-node-attributes self-closing)))
- (is (null (cl-xml:xml-node-children self-closing)))
+ (io.github.cl-sdk.xml:xml-node-attributes self-closing)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children self-closing)))
;; child with explicit closing tag
- (is (string= "node-with-children" (cl-xml:xml-node-tag with-children)))
+ (is (string= "node-with-children" (io.github.cl-sdk.xml:xml-node-tag with-children)))
(is (equal '(("attribute-name" . "attribute-value"))
- (cl-xml:xml-node-attributes with-children)))
- (is (null (cl-xml:xml-node-children with-children))))))
+ (io.github.cl-sdk.xml:xml-node-attributes with-children)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children with-children))))))
(test multiple-attributes
"An element with multiple attributes preserves order."
(let ((node (parse-root "")))
(is (equal '(("a" . "1") ("b" . "2") ("c" . "3"))
- (cl-xml:xml-node-attributes node)))))
+ (io.github.cl-sdk.xml:xml-node-attributes node)))))
(test deeply-nested
"Deeply nested elements are parsed correctly."
(let* ((root (parse-root ""))
- (b (first (cl-xml:xml-node-children root)))
- (c (first (cl-xml:xml-node-children b))))
- (is (string= "a" (cl-xml:xml-node-tag root)))
- (is (string= "b" (cl-xml:xml-node-tag b)))
- (is (string= "c" (cl-xml:xml-node-tag c)))
- (is (null (cl-xml:xml-node-children c)))))
+ (b (first (io.github.cl-sdk.xml:xml-node-children root)))
+ (c (first (io.github.cl-sdk.xml:xml-node-children b))))
+ (is (string= "a" (io.github.cl-sdk.xml:xml-node-tag root)))
+ (is (string= "b" (io.github.cl-sdk.xml:xml-node-tag b)))
+ (is (string= "c" (io.github.cl-sdk.xml:xml-node-tag c)))
+ (is (null (io.github.cl-sdk.xml:xml-node-children c)))))
;;; ── xml-document structure ───────────────────────────────────────────────
(test parse-xml-returns-document
"parse-xml returns an xml-document with prolog and root fields."
- (let ((doc (cl-xml:parse-xml "")))
- (is (cl-xml:xml-document-p doc))
- (is (null (cl-xml:xml-document-prolog doc)))
- (is (cl-xml:xml-node-p (cl-xml:xml-document-root doc)))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (io.github.cl-sdk.xml:xml-document-p doc))
+ (is (null (io.github.cl-sdk.xml:xml-document-prolog doc)))
+ (is (io.github.cl-sdk.xml:xml-node-p (io.github.cl-sdk.xml:xml-document-root doc)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
;;; ── XML 1.0 conformance — Names (§2.3) ──────────────────────────────────
(test valid-name-with-underscore-and-hyphen
"Names may contain underscores, hyphens, and dots after the first char."
(let ((node (parse-root "<_my-tag.1 />")))
- (is (string= "_my-tag.1" (cl-xml:xml-node-tag node)))))
+ (is (string= "_my-tag.1" (io.github.cl-sdk.xml:xml-node-tag node)))))
(test valid-name-with-colon
"Colons are valid XML name characters."
(let ((node (parse-root "")))
- (is (string= "ns:tag" (cl-xml:xml-node-tag node)))))
+ (is (string= "ns:tag" (io.github.cl-sdk.xml:xml-node-tag node)))))
(test invalid-name-start-digit
"A name starting with a digit is a well-formedness error."
- (signals error (cl-xml:parse-xml "<1tag />")))
+ (signals error (io.github.cl-sdk.xml:parse-xml "<1tag />")))
(test invalid-name-start-hyphen
"A name starting with a hyphen is a well-formedness error."
- (signals error (cl-xml:parse-xml "<-tag />")))
+ (signals error (io.github.cl-sdk.xml:parse-xml "<-tag />")))
;;; ── XML 1.0 conformance — Attributes (§3.1, §3.3.3) ─────────────────────
(test duplicate-attribute-error
"Duplicate attribute names on the same element are a well-formedness error."
- (signals error (cl-xml:parse-xml "")))
+ (signals error (io.github.cl-sdk.xml:parse-xml "")))
(test lt-in-attribute-value-error
"A literal '<' inside an attribute value is a well-formedness error."
- (signals error (cl-xml:parse-xml "")))
+ (signals error (io.github.cl-sdk.xml:parse-xml "")))
;;; ── XML 1.0 conformance — Entity references (§4.6) ──────────────────────
(test entity-ref-amp-in-attribute
"& in an attribute value expands to '&'."
(let ((node (parse-root "")))
- (is (string= "a&b" (cdr (assoc "v" (cl-xml:xml-node-attributes node)
+ (is (string= "a&b" (cdr (assoc "v" (io.github.cl-sdk.xml:xml-node-attributes node)
:test #'string=))))))
(test entity-ref-lt-in-attribute
"< in an attribute value expands to '<'."
(let ((node (parse-root "")))
- (is (string= "a'."
(let ((node (parse-root "")))
- (is (string= "a>b" (cdr (assoc "v" (cl-xml:xml-node-attributes node)
+ (is (string= "a>b" (cdr (assoc "v" (io.github.cl-sdk.xml:xml-node-attributes node)
:test #'string=))))))
(test entity-ref-quot-in-attribute
"" in a single-quoted attribute value expands to '\"'."
(let ((node (parse-root "")))
- (is (string= "a\"b" (cdr (assoc "v" (cl-xml:xml-node-attributes node)
+ (is (string= "a\"b" (cdr (assoc "v" (io.github.cl-sdk.xml:xml-node-attributes node)
:test #'string=))))))
(test entity-ref-apos-in-attribute
"' in a double-quoted attribute value expands to \"'\"."
(let ((node (parse-root "")))
- (is (string= "a'b" (cdr (assoc "v" (cl-xml:xml-node-attributes node)
+ (is (string= "a'b" (cdr (assoc "v" (io.github.cl-sdk.xml:xml-node-attributes node)
:test #'string=))))))
(test unknown-entity-ref-error
"An unknown named entity reference signals an error."
- (signals error (cl-xml:parse-xml "")))
+ (signals error (io.github.cl-sdk.xml:parse-xml "")))
;;; ── XML 1.0 conformance — Character references (§4.1) ───────────────────
(test char-ref-decimal
"A decimal character reference A expands to 'A'."
(let ((node (parse-root "")))
- (is (string= "A" (cdr (assoc "v" (cl-xml:xml-node-attributes node)
+ (is (string= "A" (cdr (assoc "v" (io.github.cl-sdk.xml:xml-node-attributes node)
:test #'string=))))))
(test char-ref-hex
"A hexadecimal character reference A expands to 'A'."
(let ((node (parse-root "")))
- (is (string= "A" (cdr (assoc "v" (cl-xml:xml-node-attributes node)
+ (is (string= "A" (cdr (assoc "v" (io.github.cl-sdk.xml:xml-node-attributes node)
:test #'string=))))))
;;; ── XML 1.0 conformance — Character data (§2.4) ─────────────────────────
@@ -187,7 +187,7 @@
(test text-content-preserved
"Non-whitespace text content is preserved as a string child."
(let* ((root (parse-root "
hello
"))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (= 1 (length children)))
(is (stringp (first children)))
(is (string= "hello" (first children)))))
@@ -195,7 +195,7 @@
(test text-with-entity-ref
"Entity references in text content are expanded."
(let* ((root (parse-root "a&b
"))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (string= "a&b" (first children)))))
(test whitespace-only-text-discarded
@@ -204,154 +204,154 @@
")))
- (is (= 2 (length (cl-xml:xml-node-children root))))
- (is (every #'cl-xml:xml-node-p (cl-xml:xml-node-children root)))))
+ (is (= 2 (length (io.github.cl-sdk.xml:xml-node-children root))))
+ (is (every #'io.github.cl-sdk.xml:xml-node-p (io.github.cl-sdk.xml:xml-node-children root)))))
;;; ── XML 1.0 conformance — CDATA sections (§2.7) ─────────────────────────
(test cdata-section-preserved-as-node
"A CDATA section is preserved as an xml-cdata child node."
(let* ((root (parse-root "&c]]>"))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (= 1 (length children)))
- (is (cl-xml:xml-cdata-p (first children)))
- (is (string= "a&c" (cl-xml:xml-cdata-data (first children))))))
+ (is (io.github.cl-sdk.xml:xml-cdata-p (first children)))
+ (is (string= "a&c" (io.github.cl-sdk.xml:xml-cdata-data (first children))))))
(test cdata-whitespace-only-preserved
"A CDATA section containing only whitespace is still preserved as a node."
(let* ((root (parse-root ""))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (= 1 (length children)))
- (is (cl-xml:xml-cdata-p (first children)))
- (is (string= " " (cl-xml:xml-cdata-data (first children))))))
+ (is (io.github.cl-sdk.xml:xml-cdata-p (first children)))
+ (is (string= " " (io.github.cl-sdk.xml:xml-cdata-data (first children))))))
;;; ── XML 1.0 conformance — Comments (§2.5) ───────────────────────────────
(test comment-preserved-as-node
"Comments inside an element are preserved as xml-comment child nodes."
(let* ((root (parse-root ""))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (= 2 (length children)))
- (is (cl-xml:xml-comment-p (first children)))
- (is (string= " hello " (cl-xml:xml-comment-data (first children))))
- (is (cl-xml:xml-node-p (second children)))
- (is (string= "child" (cl-xml:xml-node-tag (second children))))))
+ (is (io.github.cl-sdk.xml:xml-comment-p (first children)))
+ (is (string= " hello " (io.github.cl-sdk.xml:xml-comment-data (first children))))
+ (is (io.github.cl-sdk.xml:xml-node-p (second children)))
+ (is (string= "child" (io.github.cl-sdk.xml:xml-node-tag (second children))))))
(test multiple-comments-in-element
"Multiple comments between elements are each preserved as xml-comment nodes."
(let* ((root (parse-root ""))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (= 3 (length children)))
- (is (cl-xml:xml-comment-p (first children)))
- (is (string= " a " (cl-xml:xml-comment-data (first children))))
- (is (cl-xml:xml-comment-p (second children)))
- (is (string= " b " (cl-xml:xml-comment-data (second children))))
- (is (cl-xml:xml-node-p (third children)))))
+ (is (io.github.cl-sdk.xml:xml-comment-p (first children)))
+ (is (string= " a " (io.github.cl-sdk.xml:xml-comment-data (first children))))
+ (is (io.github.cl-sdk.xml:xml-comment-p (second children)))
+ (is (string= " b " (io.github.cl-sdk.xml:xml-comment-data (second children))))
+ (is (io.github.cl-sdk.xml:xml-node-p (third children)))))
(test illegal-double-dash-in-comment
"The sequence '--' inside a comment (not as part of '-->') is an error."
- (signals error (cl-xml:parse-xml "")))
+ (signals error (io.github.cl-sdk.xml:parse-xml "")))
;;; ── XML 1.0 conformance — Processing instructions (§2.6) ────────────────
(test pi-preserved-as-node
"Processing instructions inside an element are preserved as xml-pi nodes."
(let* ((root (parse-root ""))
- (children (cl-xml:xml-node-children root)))
+ (children (io.github.cl-sdk.xml:xml-node-children root)))
(is (= 2 (length children)))
- (is (cl-xml:xml-pi-p (first children)))
- (is (string= "app" (cl-xml:xml-pi-target (first children))))
- (is (string= "data" (cl-xml:xml-pi-data (first children))))
- (is (cl-xml:xml-node-p (second children)))))
+ (is (io.github.cl-sdk.xml:xml-pi-p (first children)))
+ (is (string= "app" (io.github.cl-sdk.xml:xml-pi-target (first children))))
+ (is (string= "data" (io.github.cl-sdk.xml:xml-pi-data (first children))))
+ (is (io.github.cl-sdk.xml:xml-node-p (second children)))))
(test pi-no-data
"A processing instruction with no data has an empty data string."
(let* ((root (parse-root ""))
- (pinstruction (first (cl-xml:xml-node-children root))))
- (is (cl-xml:xml-pi-p pinstruction))
- (is (string= "foo" (cl-xml:xml-pi-target pinstruction)))
- (is (string= "" (cl-xml:xml-pi-data pinstruction)))))
+ (pinstruction (first (io.github.cl-sdk.xml:xml-node-children root))))
+ (is (io.github.cl-sdk.xml:xml-pi-p pinstruction))
+ (is (string= "foo" (io.github.cl-sdk.xml:xml-pi-target pinstruction)))
+ (is (string= "" (io.github.cl-sdk.xml:xml-pi-data pinstruction)))))
;;; ── XML 1.0 conformance — Prolog (§2.8) ─────────────────────────────────
(test xml-declaration-in-prolog
"An XML declaration is preserved as an xml-pi node in the document prolog."
- (let ((doc (cl-xml:parse-xml "")))
- (is (= 1 (length (cl-xml:xml-document-prolog doc))))
- (let ((decl (first (cl-xml:xml-document-prolog doc))))
- (is (cl-xml:xml-pi-p decl))
- (is (string= "xml" (cl-xml:xml-pi-target decl))))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (= 1 (length (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (let ((decl (first (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (is (io.github.cl-sdk.xml:xml-pi-p decl))
+ (is (string= "xml" (io.github.cl-sdk.xml:xml-pi-target decl))))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
(test doctype-skipped
"A DOCTYPE declaration in the prolog is silently skipped."
- (let ((doc (cl-xml:parse-xml "")))
- (is (null (cl-xml:xml-document-prolog doc)))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (null (io.github.cl-sdk.xml:xml-document-prolog doc)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
(test doctype-with-internal-subset-skipped
"A DOCTYPE with an internal subset is silently skipped."
- (let ((doc (cl-xml:parse-xml "]>")))
- (is (null (cl-xml:xml-document-prolog doc)))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "]>")))
+ (is (null (io.github.cl-sdk.xml:xml-document-prolog doc)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
(test prolog-comment-preserved
"A comment in the document prolog is preserved as an xml-comment node."
- (let ((doc (cl-xml:parse-xml "")))
- (is (= 1 (length (cl-xml:xml-document-prolog doc))))
- (is (cl-xml:xml-comment-p (first (cl-xml:xml-document-prolog doc))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (= 1 (length (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (is (io.github.cl-sdk.xml:xml-comment-p (first (io.github.cl-sdk.xml:xml-document-prolog doc))))
(is (string= " intro "
- (cl-xml:xml-comment-data
- (first (cl-xml:xml-document-prolog doc)))))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (io.github.cl-sdk.xml:xml-comment-data
+ (first (io.github.cl-sdk.xml:xml-document-prolog doc)))))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
(test prolog-pi-preserved
"A processing instruction in the document prolog is preserved as xml-pi."
- (let ((doc (cl-xml:parse-xml "")))
- (is (= 1 (length (cl-xml:xml-document-prolog doc))))
- (is (cl-xml:xml-pi-p (first (cl-xml:xml-document-prolog doc))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (= 1 (length (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (is (io.github.cl-sdk.xml:xml-pi-p (first (io.github.cl-sdk.xml:xml-document-prolog doc))))
(is (string= "stylesheet"
- (cl-xml:xml-pi-target (first (cl-xml:xml-document-prolog doc)))))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (io.github.cl-sdk.xml:xml-pi-target (first (io.github.cl-sdk.xml:xml-document-prolog doc)))))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
;;; ── SAX handler — collecting helper ─────────────────────────────────────
-(defclass collecting-handler (cl-xml:sax-handler)
+(defclass collecting-handler (io.github.cl-sdk.xml:sax-handler)
((events :initform '() :accessor handler-events))
(:documentation "SAX handler that accumulates all events into a list."))
-(defmethod cl-xml:start-element ((h collecting-handler) tag attributes)
+(defmethod io.github.cl-sdk.xml:start-element ((h collecting-handler) tag attributes)
(push (list :start-element tag attributes) (handler-events h)))
-(defmethod cl-xml:end-element ((h collecting-handler) tag)
+(defmethod io.github.cl-sdk.xml:end-element ((h collecting-handler) tag)
(push (list :end-element tag) (handler-events h)))
-(defmethod cl-xml:characters ((h collecting-handler) text)
+(defmethod io.github.cl-sdk.xml:characters ((h collecting-handler) text)
(push (list :characters text) (handler-events h)))
-(defmethod cl-xml:comment ((h collecting-handler) data)
+(defmethod io.github.cl-sdk.xml:comment ((h collecting-handler) data)
(push (list :comment data) (handler-events h)))
-(defmethod cl-xml:processing-instruction ((h collecting-handler) target data)
+(defmethod io.github.cl-sdk.xml:processing-instruction ((h collecting-handler) target data)
(push (list :pi target data) (handler-events h)))
-(defmethod cl-xml:cdata-section ((h collecting-handler) data)
+(defmethod io.github.cl-sdk.xml:cdata-section ((h collecting-handler) data)
(push (list :cdata data) (handler-events h)))
-(defmethod cl-xml:end-document ((h collecting-handler))
+(defmethod io.github.cl-sdk.xml:end-document ((h collecting-handler))
(nreverse (handler-events h)))
(defun sax-events (str)
"Parse STR with a COLLECTING-HANDLER and return the event list."
- (cl-xml:parse-xml str :handler (make-instance 'collecting-handler)))
+ (io.github.cl-sdk.xml:parse-xml str :handler (make-instance 'collecting-handler)))
;;; ── SAX handler tests ─────────────────────────────────────────────────────
(test sax-default-returns-document
"parse-xml without :handler returns an xml-document (backward compat)."
- (let ((doc (cl-xml:parse-xml "")))
- (is (cl-xml:xml-document-p doc))
- (is (string= "root" (cl-xml:xml-node-tag (cl-xml:xml-document-root doc))))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (io.github.cl-sdk.xml:xml-document-p doc))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag (io.github.cl-sdk.xml:xml-document-root doc))))))
(test sax-self-closing-events
"A self-closing element fires start-element then end-element."
@@ -436,7 +436,7 @@
(test sax-end-document-return-value
"The return value of END-DOCUMENT becomes the return value of PARSE-XML."
- (let ((result (cl-xml:parse-xml "" :handler (make-instance 'collecting-handler))))
+ (let ((result (io.github.cl-sdk.xml:parse-xml "" :handler (make-instance 'collecting-handler))))
(is (listp result))
(is (equal '(:start-element "x" nil) (first result)))
(is (equal '(:end-element "x") (second result)))))
@@ -446,8 +446,8 @@
(let ((root (parse-root "
")))
- (is (= 1 (length (cl-xml:xml-node-children root))))
- (is (cl-xml:xml-node-p (first (cl-xml:xml-node-children root))))))
+ (is (= 1 (length (io.github.cl-sdk.xml:xml-node-children root))))
+ (is (io.github.cl-sdk.xml:xml-node-p (first (io.github.cl-sdk.xml:xml-node-children root))))))
(test full-prolog
"A document with XML decl, DOCTYPE, and a prolog comment is parsed correctly."
@@ -456,24 +456,24 @@
""
""
""))
- (doc (cl-xml:parse-xml xml)))
+ (doc (io.github.cl-sdk.xml:parse-xml xml)))
;; XML decl (as xml-pi) + prolog comment = 2 items; DOCTYPE is skipped
- (is (= 2 (length (cl-xml:xml-document-prolog doc))))
- (is (cl-xml:xml-pi-p (first (cl-xml:xml-document-prolog doc))))
- (is (cl-xml:xml-comment-p (second (cl-xml:xml-document-prolog doc))))
- (let ((root (cl-xml:xml-document-root doc)))
- (is (string= "root" (cl-xml:xml-node-tag root)))
- (is (= 1 (length (cl-xml:xml-node-children root)))))))
+ (is (= 2 (length (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (is (io.github.cl-sdk.xml:xml-pi-p (first (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (is (io.github.cl-sdk.xml:xml-comment-p (second (io.github.cl-sdk.xml:xml-document-prolog doc))))
+ (let ((root (io.github.cl-sdk.xml:xml-document-root doc)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-node-tag root)))
+ (is (= 1 (length (io.github.cl-sdk.xml:xml-node-children root)))))))
;;; ── Stream input ──────────────────────────────────────────────────────────
(test parse-xml-accepts-stream
"parse-xml accepts a character stream in addition to a string."
(let* ((stream (make-string-input-stream "text"))
- (root (cl-xml:xml-document-root (cl-xml:parse-xml stream))))
- (is (string= "tag" (cl-xml:xml-node-tag root)))
- (is (equal '(("attr" . "val")) (cl-xml:xml-node-attributes root)))
- (is (string= "text" (first (cl-xml:xml-node-children root))))))
+ (root (io.github.cl-sdk.xml:xml-document-root (io.github.cl-sdk.xml:parse-xml stream))))
+ (is (string= "tag" (io.github.cl-sdk.xml:xml-node-tag root)))
+ (is (equal '(("attr" . "val")) (io.github.cl-sdk.xml:xml-node-attributes root)))
+ (is (string= "text" (first (io.github.cl-sdk.xml:xml-node-children root))))))
;;; ── trivial-gray-streams input ────────────────────────────────────────────
@@ -497,168 +497,168 @@
"parse-xml accepts a trivial-gray-streams fundamental-character-input-stream."
(let* ((inner (make-string-input-stream "hello"))
(stream (make-instance 'test-gray-stream :inner inner))
- (root (cl-xml:xml-document-root (cl-xml:parse-xml stream))))
- (is (string= "el" (cl-xml:xml-node-tag root)))
- (is (equal '(("key" . "v")) (cl-xml:xml-node-attributes root)))
- (is (string= "hello" (first (cl-xml:xml-node-children root))))))
+ (root (io.github.cl-sdk.xml:xml-document-root (io.github.cl-sdk.xml:parse-xml stream))))
+ (is (string= "el" (io.github.cl-sdk.xml:xml-node-tag root)))
+ (is (equal '(("key" . "v")) (io.github.cl-sdk.xml:xml-node-attributes root)))
+ (is (string= "hello" (first (io.github.cl-sdk.xml:xml-node-children root))))))
;;; ── Namespace resolution (resolve-namespaces) ────────────────────────────
(defun resolve-root-tag (str)
"Parse STR, resolve namespaces, and return the tag (xml-qname) of the root xml-node."
- (cl-xml:xml-node-tag
- (cl-xml:xml-document-root
- (cl-xml:resolve-namespaces (cl-xml:parse-xml str)))))
+ (io.github.cl-sdk.xml:xml-node-tag
+ (io.github.cl-sdk.xml:xml-document-root
+ (io.github.cl-sdk.xml:resolve-namespaces (io.github.cl-sdk.xml:parse-xml str)))))
(test ns-qname-struct
"xml-qname struct has prefix, local-name, and namespace-uri fields."
- (let ((q (cl-xml:make-xml-qname :prefix "ns" :local-name "tag"
+ (let ((q (io.github.cl-sdk.xml:make-xml-qname :prefix "ns" :local-name "tag"
:namespace-uri "http://example.com/")))
- (is (cl-xml:xml-qname-p q))
- (is (string= "ns" (cl-xml:xml-qname-prefix q)))
- (is (string= "tag" (cl-xml:xml-qname-local-name q)))
- (is (string= "http://example.com/" (cl-xml:xml-qname-namespace-uri q)))))
+ (is (io.github.cl-sdk.xml:xml-qname-p q))
+ (is (string= "ns" (io.github.cl-sdk.xml:xml-qname-prefix q)))
+ (is (string= "tag" (io.github.cl-sdk.xml:xml-qname-local-name q)))
+ (is (string= "http://example.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri q)))))
(test ns-resolve-prefixed-element
"A prefixed element tag is resolved to an xml-qname with the correct URI."
(let ((tag (resolve-root-tag "")))
- (is (cl-xml:xml-qname-p tag))
- (is (string= "ns" (cl-xml:xml-qname-prefix tag)))
- (is (string= "root" (cl-xml:xml-qname-local-name tag)))
- (is (string= "http://example.com/" (cl-xml:xml-qname-namespace-uri tag)))))
+ (is (io.github.cl-sdk.xml:xml-qname-p tag))
+ (is (string= "ns" (io.github.cl-sdk.xml:xml-qname-prefix tag)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-qname-local-name tag)))
+ (is (string= "http://example.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri tag)))))
(test ns-resolve-default-namespace
"An unprefixed element in a default namespace gets the declared namespace URI."
(let ((tag (resolve-root-tag "")))
- (is (cl-xml:xml-qname-p tag))
- (is (null (cl-xml:xml-qname-prefix tag)))
- (is (string= "root" (cl-xml:xml-qname-local-name tag)))
- (is (string= "http://example.com/" (cl-xml:xml-qname-namespace-uri tag)))))
+ (is (io.github.cl-sdk.xml:xml-qname-p tag))
+ (is (null (io.github.cl-sdk.xml:xml-qname-prefix tag)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-qname-local-name tag)))
+ (is (string= "http://example.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri tag)))))
(test ns-resolve-no-namespace
"An unprefixed element with no default namespace has nil namespace-uri."
(let ((tag (resolve-root-tag "")))
- (is (cl-xml:xml-qname-p tag))
- (is (null (cl-xml:xml-qname-prefix tag)))
- (is (string= "root" (cl-xml:xml-qname-local-name tag)))
- (is (null (cl-xml:xml-qname-namespace-uri tag)))))
+ (is (io.github.cl-sdk.xml:xml-qname-p tag))
+ (is (null (io.github.cl-sdk.xml:xml-qname-prefix tag)))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-qname-local-name tag)))
+ (is (null (io.github.cl-sdk.xml:xml-qname-namespace-uri tag)))))
(test ns-resolve-xmlns-attrs-removed
"xmlns and xmlns:prefix attributes are absent after resolve-namespaces."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
""))
- (resolved (cl-xml:resolve-namespaces doc))
- (attrs (cl-xml:xml-node-attributes
- (cl-xml:xml-document-root resolved))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (attrs (io.github.cl-sdk.xml:xml-node-attributes
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
(is (null attrs))))
(test ns-resolve-prefixed-attribute
"A prefixed attribute key is resolved to an xml-qname with the correct URI."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
""))
- (resolved (cl-xml:resolve-namespaces doc))
- (attrs (cl-xml:xml-node-attributes
- (cl-xml:xml-document-root resolved))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (attrs (io.github.cl-sdk.xml:xml-node-attributes
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
(is (= 1 (length attrs)))
(let ((key (caar attrs)))
- (is (cl-xml:xml-qname-p key))
- (is (string= "ns" (cl-xml:xml-qname-prefix key)))
- (is (string= "attr" (cl-xml:xml-qname-local-name key)))
- (is (string= "http://example.com/" (cl-xml:xml-qname-namespace-uri key))))
+ (is (io.github.cl-sdk.xml:xml-qname-p key))
+ (is (string= "ns" (io.github.cl-sdk.xml:xml-qname-prefix key)))
+ (is (string= "attr" (io.github.cl-sdk.xml:xml-qname-local-name key)))
+ (is (string= "http://example.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri key))))
(is (string= "val" (cdar attrs)))))
(test ns-resolve-unprefixed-attribute-has-no-ns
"An unprefixed attribute has nil namespace-uri even when a default ns is active."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
""))
- (resolved (cl-xml:resolve-namespaces doc))
- (attrs (cl-xml:xml-node-attributes
- (cl-xml:xml-document-root resolved))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (attrs (io.github.cl-sdk.xml:xml-node-attributes
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
(is (= 1 (length attrs)))
(let ((key (caar attrs)))
- (is (cl-xml:xml-qname-p key))
- (is (null (cl-xml:xml-qname-prefix key)))
- (is (string= "attr" (cl-xml:xml-qname-local-name key)))
- (is (null (cl-xml:xml-qname-namespace-uri key))))))
+ (is (io.github.cl-sdk.xml:xml-qname-p key))
+ (is (null (io.github.cl-sdk.xml:xml-qname-prefix key)))
+ (is (string= "attr" (io.github.cl-sdk.xml:xml-qname-local-name key)))
+ (is (null (io.github.cl-sdk.xml:xml-qname-namespace-uri key))))))
(test ns-resolve-inherited-binding
"Namespace bindings declared on a parent are visible in child elements."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
""))
- (resolved (cl-xml:resolve-namespaces doc))
- (child (first (cl-xml:xml-node-children
- (cl-xml:xml-document-root resolved))))
- (ctag (cl-xml:xml-node-tag child)))
- (is (cl-xml:xml-qname-p ctag))
- (is (string= "ns" (cl-xml:xml-qname-prefix ctag)))
- (is (string= "child" (cl-xml:xml-qname-local-name ctag)))
- (is (string= "http://example.com/" (cl-xml:xml-qname-namespace-uri ctag)))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (child (first (io.github.cl-sdk.xml:xml-node-children
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
+ (ctag (io.github.cl-sdk.xml:xml-node-tag child)))
+ (is (io.github.cl-sdk.xml:xml-qname-p ctag))
+ (is (string= "ns" (io.github.cl-sdk.xml:xml-qname-prefix ctag)))
+ (is (string= "child" (io.github.cl-sdk.xml:xml-qname-local-name ctag)))
+ (is (string= "http://example.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri ctag)))))
(test ns-resolve-xml-prefix-predeclared
"The 'xml' prefix is pre-declared and resolves without an explicit xmlns:xml."
- (let* ((doc (cl-xml:parse-xml ""))
- (resolved (cl-xml:resolve-namespaces doc))
- (attrs (cl-xml:xml-node-attributes
- (cl-xml:xml-document-root resolved))))
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml ""))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (attrs (io.github.cl-sdk.xml:xml-node-attributes
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
(is (= 1 (length attrs)))
(let ((key (caar attrs)))
- (is (string= "xml" (cl-xml:xml-qname-prefix key)))
- (is (string= "lang" (cl-xml:xml-qname-local-name key)))
+ (is (string= "xml" (io.github.cl-sdk.xml:xml-qname-prefix key)))
+ (is (string= "lang" (io.github.cl-sdk.xml:xml-qname-local-name key)))
(is (string= "http://www.w3.org/XML/1998/namespace"
- (cl-xml:xml-qname-namespace-uri key))))))
+ (io.github.cl-sdk.xml:xml-qname-namespace-uri key))))))
(test ns-resolve-undeclared-prefix-error
"Using an undeclared namespace prefix signals an error."
(signals error
- (cl-xml:resolve-namespaces (cl-xml:parse-xml ""))))
+ (io.github.cl-sdk.xml:resolve-namespaces (io.github.cl-sdk.xml:parse-xml ""))))
(test ns-resolve-default-ns-reset
"An xmlns='' declaration on a child resets the default namespace to nil."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
""))
- (resolved (cl-xml:resolve-namespaces doc))
- (child (first (cl-xml:xml-node-children
- (cl-xml:xml-document-root resolved))))
- (ctag (cl-xml:xml-node-tag child)))
- (is (null (cl-xml:xml-qname-namespace-uri ctag)))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (child (first (io.github.cl-sdk.xml:xml-node-children
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
+ (ctag (io.github.cl-sdk.xml:xml-node-tag child)))
+ (is (null (io.github.cl-sdk.xml:xml-qname-namespace-uri ctag)))))
(test ns-resolve-returns-xml-document
"resolve-namespaces returns an xml-document."
- (let ((resolved (cl-xml:resolve-namespaces (cl-xml:parse-xml ""))))
- (is (cl-xml:xml-document-p resolved))))
+ (let ((resolved (io.github.cl-sdk.xml:resolve-namespaces (io.github.cl-sdk.xml:parse-xml ""))))
+ (is (io.github.cl-sdk.xml:xml-document-p resolved))))
(test ns-resolve-preserves-prolog
"resolve-namespaces preserves the document prolog unchanged."
- (let* ((doc (cl-xml:parse-xml ""))
- (resolved (cl-xml:resolve-namespaces doc)))
- (is (equal (cl-xml:xml-document-prolog doc)
- (cl-xml:xml-document-prolog resolved)))))
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml ""))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc)))
+ (is (equal (io.github.cl-sdk.xml:xml-document-prolog doc)
+ (io.github.cl-sdk.xml:xml-document-prolog resolved)))))
(test ns-resolve-multiple-prefixes
"Multiple namespace prefixes on the same element are all resolved correctly."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
(concatenate 'string
"")))
- (resolved (cl-xml:resolve-namespaces doc))
- (attrs (cl-xml:xml-node-attributes
- (cl-xml:xml-document-root resolved))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (attrs (io.github.cl-sdk.xml:xml-node-attributes
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
(is (= 2 (length attrs)))
- (let ((a-attr (find "x" attrs :key (lambda (e) (cl-xml:xml-qname-local-name (car e)))
+ (let ((a-attr (find "x" attrs :key (lambda (e) (io.github.cl-sdk.xml:xml-qname-local-name (car e)))
:test #'string=))
- (b-attr (find "y" attrs :key (lambda (e) (cl-xml:xml-qname-local-name (car e)))
+ (b-attr (find "y" attrs :key (lambda (e) (io.github.cl-sdk.xml:xml-qname-local-name (car e)))
:test #'string=)))
- (is (string= "http://a.com/" (cl-xml:xml-qname-namespace-uri (car a-attr))))
- (is (string= "http://b.com/" (cl-xml:xml-qname-namespace-uri (car b-attr)))))))
+ (is (string= "http://a.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri (car a-attr))))
+ (is (string= "http://b.com/" (io.github.cl-sdk.xml:xml-qname-namespace-uri (car b-attr)))))))
(test ns-resolve-preserves-text-children
"Text and CDATA children are passed through unchanged by resolve-namespaces."
- (let* ((doc (cl-xml:parse-xml
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml
"hello"))
- (resolved (cl-xml:resolve-namespaces doc))
- (children (cl-xml:xml-node-children
- (cl-xml:xml-document-root resolved))))
+ (resolved (io.github.cl-sdk.xml:resolve-namespaces doc))
+ (children (io.github.cl-sdk.xml:xml-node-children
+ (io.github.cl-sdk.xml:xml-document-root resolved))))
(is (= 1 (length children)))
(is (string= "hello" (first children)))))
@@ -668,73 +668,73 @@
(defun parse-doctype-elements (str)
"Parse STR and return the list of xml-dtd-element structs from the DOCTYPE."
- (cl-xml:xml-doctype-elements
- (cl-xml:xml-document-doctype (cl-xml:parse-xml str))))
+ (io.github.cl-sdk.xml:xml-doctype-elements
+ (io.github.cl-sdk.xml:xml-document-doctype (io.github.cl-sdk.xml:parse-xml str))))
;;; xml-dtd-element struct
(test dtd-element-struct
"xml-dtd-element struct has name and content-model fields."
- (let ((e (cl-xml:make-xml-dtd-element :name "root" :content-model :empty)))
- (is (cl-xml:xml-dtd-element-p e))
- (is (string= "root" (cl-xml:xml-dtd-element-name e)))
- (is (eq :empty (cl-xml:xml-dtd-element-content-model e)))))
+ (let ((e (io.github.cl-sdk.xml:make-xml-dtd-element :name "root" :content-model :empty)))
+ (is (io.github.cl-sdk.xml:xml-dtd-element-p e))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-dtd-element-name e)))
+ (is (eq :empty (io.github.cl-sdk.xml:xml-dtd-element-content-model e)))))
;;; xml-doctype struct
(test dtd-doctype-struct
"xml-doctype struct has name, public-id, system-id, and elements fields."
- (let ((d (cl-xml:make-xml-doctype :name "root" :public-id nil
+ (let ((d (io.github.cl-sdk.xml:make-xml-doctype :name "root" :public-id nil
:system-id "root.dtd" :elements '())))
- (is (cl-xml:xml-doctype-p d))
- (is (string= "root" (cl-xml:xml-doctype-name d)))
- (is (null (cl-xml:xml-doctype-public-id d)))
- (is (string= "root.dtd" (cl-xml:xml-doctype-system-id d)))
- (is (null (cl-xml:xml-doctype-elements d)))))
+ (is (io.github.cl-sdk.xml:xml-doctype-p d))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-doctype-name d)))
+ (is (null (io.github.cl-sdk.xml:xml-doctype-public-id d)))
+ (is (string= "root.dtd" (io.github.cl-sdk.xml:xml-doctype-system-id d)))
+ (is (null (io.github.cl-sdk.xml:xml-doctype-elements d)))))
;;; xml-document-doctype accessor
(test no-doctype-gives-nil
"A document without a DOCTYPE has xml-document-doctype = NIL."
- (let ((doc (cl-xml:parse-xml "")))
- (is (null (cl-xml:xml-document-doctype doc)))))
+ (let ((doc (io.github.cl-sdk.xml:parse-xml "")))
+ (is (null (io.github.cl-sdk.xml:xml-document-doctype doc)))))
(test doctype-present
"A document with a DOCTYPE has a non-nil xml-doctype in xml-document-doctype."
- (let* ((doc (cl-xml:parse-xml ""))
- (dtd (cl-xml:xml-document-doctype doc)))
- (is (cl-xml:xml-doctype-p dtd))
- (is (string= "root" (cl-xml:xml-doctype-name dtd)))))
+ (let* ((doc (io.github.cl-sdk.xml:parse-xml ""))
+ (dtd (io.github.cl-sdk.xml:xml-document-doctype doc)))
+ (is (io.github.cl-sdk.xml:xml-doctype-p dtd))
+ (is (string= "root" (io.github.cl-sdk.xml:xml-doctype-name dtd)))))
(test doctype-no-external-id
"A DOCTYPE with no external identifier has nil public-id and system-id."
- (let* ((dtd (cl-xml:xml-document-doctype
- (cl-xml:parse-xml ""))))
- (is (null (cl-xml:xml-doctype-public-id dtd)))
- (is (null (cl-xml:xml-doctype-system-id dtd)))))
+ (let* ((dtd (io.github.cl-sdk.xml:xml-document-doctype
+ (io.github.cl-sdk.xml:parse-xml ""))))
+ (is (null (io.github.cl-sdk.xml:xml-doctype-public-id dtd)))
+ (is (null (io.github.cl-sdk.xml:xml-doctype-system-id dtd)))))
(test doctype-system-id
"A DOCTYPE with SYSTEM identifier records the system-id."
- (let* ((dtd (cl-xml:xml-document-doctype
- (cl-xml:parse-xml
+ (let* ((dtd (io.github.cl-sdk.xml:xml-document-doctype
+ (io.github.cl-sdk.xml:parse-xml
""))))
- (is (null (cl-xml:xml-doctype-public-id dtd)))
- (is (string= "root.dtd" (cl-xml:xml-doctype-system-id dtd)))))
+ (is (null (io.github.cl-sdk.xml:xml-doctype-public-id dtd)))
+ (is (string= "root.dtd" (io.github.cl-sdk.xml:xml-doctype-system-id dtd)))))
(test doctype-public-id
"A DOCTYPE with PUBLIC identifier records both public-id and system-id."
- (let* ((dtd (cl-xml:xml-document-doctype
- (cl-xml:parse-xml
+ (let* ((dtd (io.github.cl-sdk.xml:xml-document-doctype
+ (io.github.cl-sdk.xml:parse-xml
"