@@ -112,7 +112,7 @@ the line number.")
112
112
ns
113
113
attrs
114
114
children)
115
-
115
+
116
116
(defun make-node (&key name ns attrs child children)
117
117
" Convenience function for creating a new xml node."
118
118
(when (and child children)
@@ -154,7 +154,7 @@ fixed."
154
154
(node-name node))
155
155
(node-attrs node)
156
156
(mapcar ' node->nodelist (node-children node))))))
157
-
157
+
158
158
159
159
; ;;-----------------------------------------------------------------------------
160
160
@@ -355,7 +355,7 @@ character translation."
355
355
(when (char= char #\newline )
356
356
(decf *parser-line-number* ))
357
357
(common-lisp :unread-char char stream ))
358
-
358
+
359
359
; ;;END shadowing--------------------------------------------------------------
360
360
361
361
(define-symbol-macro next-char (peek-stream (state-stream s)))
@@ -551,12 +551,12 @@ character translation."
551
551
(match #\' ))))
552
552
t )
553
553
(if (string= " xmlns" name)
554
- (list ' nsdecl suffix val)
555
- ; ; If SUFFIX is true, then NAME is Prefix and SUFFIX is
556
- ; ; LocalPart.
557
- (if suffix
558
- (list ' attr suffix val :attr-ns name)
559
- (list ' attr name val))))))
554
+ (list ' nsdecl suffix val)
555
+ ; ; If SUFFIX is true, then NAME is Prefix and SUFFIX is
556
+ ; ; LocalPart.
557
+ (if suffix
558
+ (list ' attr suffix val :attr-ns name)
559
+ (list ' attr name val))))))
560
560
561
561
(defrule ws ()
562
562
(and (match+ ws-char)
@@ -797,7 +797,7 @@ character translation."
797
797
((and (eql (element-type c) ' pi)
798
798
(not *discard-processing-instructions* ))
799
799
(return (setf elem c))))))
800
-
800
+
801
801
(and elem (element-val elem))))
802
802
803
803
; ;;-----------------------------------------------------------------------------
@@ -827,14 +827,7 @@ character translation."
827
827
(write-xml e s :indent indent)))
828
828
829
829
(defun parse (s &key (compress-whitespace t ) (quash-errors t ))
830
- " Parses the supplied stream or string into a lisp node tree.
831
-
832
- :QUASH-ERRORS, if true, will cause this function to return NIL
833
- instead of raising an error if it encounters an XML parsing
834
- error. Other errors may not be quashed.
835
-
836
- Note: This function accepts empty XML documents as input, and returns
837
- NIL in that case."
830
+ " Parses the supplied stream or string into a lisp node tree."
838
831
(let* ((*compress-whitespace* compress-whitespace)
839
832
(*discard-processing-instructions* t )
840
833
(stream
@@ -851,14 +844,7 @@ NIL in that case."
851
844
(document (make-state :stream stream )))))
852
845
853
846
(defun parse-to-list (&rest args)
854
- " Parses the supplied stream or string into the legacy XMLS
855
- s-expression format.
856
-
857
- Note: This function accepts empty XML documents as input, and returns
858
- NIL in that case."
859
- (let ((parsed (apply #' parse args)))
860
- (when parsed
861
- (node->nodelist parsed))))
847
+ (node->nodelist (apply #' parse args)))
862
848
863
849
(defparameter *test-files*
864
850
(mapcar #' (lambda (x) (asdf :system-relative-pathname " xmls" (format nil " tests/~a " x)))
@@ -898,7 +884,7 @@ NIL in that case."
898
884
" xml-rpc/methodResponse.xml"
899
885
" xml-rpc/struct.xml" )))
900
886
901
- #+ (or sbcl cmu allegro abcl ccl clisp ecl)
887
+ #+ (or sbcl cmu allegro abcl ccl clisp ecl)
902
888
(defun test (&key interactive (test-files *test-files* ))
903
889
" Run the test suite. If it fails, either return NIL \( if INTERACTIVE\) ,
904
890
otherwise exit with an error exit status."
0 commit comments