From 437efa7686f62c88f6b377a255715fa0c28ed2c7 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 22 Jan 2020 00:49:58 +0000 Subject: feat(third_party/lisp/s-xml): Check in sources & derivation Checked in the sources for this because it is tracked upstream in CVS and I can't be bothered to deal with that right now. --- third_party/lisp/s-xml/test/ant-build-file.xml | 252 +++++++++++++++++++ third_party/lisp/s-xml/test/plist.xml | 38 +++ third_party/lisp/s-xml/test/simple.xml | 5 + third_party/lisp/s-xml/test/test-lxml-dom.lisp | 86 +++++++ third_party/lisp/s-xml/test/test-sxml-dom.lisp | 76 ++++++ .../lisp/s-xml/test/test-xml-struct-dom.lisp | 84 +++++++ third_party/lisp/s-xml/test/test-xml.lisp | 86 +++++++ third_party/lisp/s-xml/test/xhtml-page.xml | 271 +++++++++++++++++++++ 8 files changed, 898 insertions(+) create mode 100644 third_party/lisp/s-xml/test/ant-build-file.xml create mode 100644 third_party/lisp/s-xml/test/plist.xml create mode 100644 third_party/lisp/s-xml/test/simple.xml create mode 100644 third_party/lisp/s-xml/test/test-lxml-dom.lisp create mode 100644 third_party/lisp/s-xml/test/test-sxml-dom.lisp create mode 100644 third_party/lisp/s-xml/test/test-xml-struct-dom.lisp create mode 100644 third_party/lisp/s-xml/test/test-xml.lisp create mode 100644 third_party/lisp/s-xml/test/xhtml-page.xml (limited to 'third_party/lisp/s-xml/test') diff --git a/third_party/lisp/s-xml/test/ant-build-file.xml b/third_party/lisp/s-xml/test/ant-build-file.xml new file mode 100644 index 0000000000..91d78707b8 --- /dev/null +++ b/third_party/lisp/s-xml/test/ant-build-file.xml @@ -0,0 +1,252 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/third_party/lisp/s-xml/test/plist.xml b/third_party/lisp/s-xml/test/plist.xml new file mode 100644 index 0000000000..910e6326ea --- /dev/null +++ b/third_party/lisp/s-xml/test/plist.xml @@ -0,0 +1,38 @@ + + + + + AppleDockIconEnabled + + AppleNavServices:GetFile:0:Path + file://localhost/Users/sven/Pictures/ + AppleNavServices:GetFile:0:Position + + AOUBXw== + + AppleNavServices:GetFile:0:Size + + AAAAAAFeAcI= + + AppleNavServices:PutFile:0:Disclosure + + AQ== + + AppleNavServices:PutFile:0:Path + file://localhost/Users/sven/Desktop/ + AppleNavServices:PutFile:0:Position + + AUIBVQ== + + AppleNavServices:PutFile:0:Size + + AAAAAACkAdY= + + AppleSavePanelExpanded + YES + NSDefaultOpenDirectory + ~/Desktop + NSNoBigString + + + diff --git a/third_party/lisp/s-xml/test/simple.xml b/third_party/lisp/s-xml/test/simple.xml new file mode 100644 index 0000000000..08ad9424e3 --- /dev/null +++ b/third_party/lisp/s-xml/test/simple.xml @@ -0,0 +1,5 @@ + + + + Hello World! + diff --git a/third_party/lisp/s-xml/test/test-lxml-dom.lisp b/third_party/lisp/s-xml/test/test-lxml-dom.lisp new file mode 100644 index 0000000000..248e1e4b90 --- /dev/null +++ b/third_party/lisp/s-xml/test/test-lxml-dom.lisp @@ -0,0 +1,86 @@ +;;;; -*- mode: lisp -*- +;;;; +;;;; $Id: test-lxml-dom.lisp,v 1.2 2005/11/06 12:44:48 scaekenberghe Exp $ +;;;; +;;;; Unit and functional tests for lxml-dom.lisp +;;;; +;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. +;;;; +;;;; You are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser General Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +(in-package :s-xml) + +(assert + (equal (with-input-from-string (stream " ") + (parse-xml stream :output-type :lxml)) + :|foo|)) + +(assert + (equal (parse-xml-string "this is some text" + :output-type :lxml) + '(:|tag1| + ((:|tag2| :|att1| "one")) + "this is some text"))) + +(assert + (equal (parse-xml-string "<foo>" + :output-type :lxml) + '(:TAG ""))) + +(assert + (equal (parse-xml-string + "

This is some bold text, with a leading & trailing space

" + :output-type :lxml) + '(:p + ((:index :item "one")) + " This is some " + (:b "bold") + " text, with a leading & trailing space "))) + +(assert + (consp (parse-xml-file (merge-pathnames "test/xhtml-page.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :lxml))) + +(assert + (consp (parse-xml-file (merge-pathnames "test/ant-build-file.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :lxml))) + +(assert + (consp (parse-xml-file (merge-pathnames "test/plist.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :lxml))) + +(assert + (string-equal (print-xml-string :|foo| :input-type :lxml) + "")) + +(assert + (string-equal (print-xml-string '((:|foo| :|bar| "1")) :input-type :lxml) + "")) + +(assert + (string-equal (print-xml-string '(:foo "some text") :input-type :lxml) + "some text")) + +(assert + (string-equal (print-xml-string '(:|foo| :|bar|) :input-type :lxml) + "")) + +(assert (string-equal (second + (with-input-from-string (stream "Hello, world!]]>") + (parse-xml stream :output-type :lxml))) + "Hello, world!")) + +(assert (string-equal (second + (with-input-from-string (stream "Hello, < world!]]>") + (parse-xml stream :output-type :lxml))) + "Hello, < world!")) + +;;;; eof diff --git a/third_party/lisp/s-xml/test/test-sxml-dom.lisp b/third_party/lisp/s-xml/test/test-sxml-dom.lisp new file mode 100644 index 0000000000..7164d5ef0d --- /dev/null +++ b/third_party/lisp/s-xml/test/test-sxml-dom.lisp @@ -0,0 +1,76 @@ +;;;; -*- mode: lisp -*- +;;;; +;;;; $Id: test-sxml-dom.lisp,v 1.1.1.1 2004/06/07 18:49:59 scaekenberghe Exp $ +;;;; +;;;; Unit and functional tests for sxml-dom.lisp +;;;; +;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. +;;;; +;;;; You are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser General Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +(in-package :s-xml) + +(assert + (equal (with-input-from-string (stream " ") + (parse-xml stream :output-type :sxml)) + '(:|foo|))) + +(assert + (equal (parse-xml-string "this is some text" + :output-type :sxml) + '(:|tag1| + (:|tag2| (:@ (:|att1| "one"))) + "this is some text"))) + +(assert + (equal (parse-xml-string "<foo>" + :output-type :sxml) + '(:TAG ""))) + +(assert + (equal (parse-xml-string + "

This is some bold text, with a leading & trailing space

" + :output-type :sxml) + '(:p + (:index (:@ (:item "one"))) + " This is some " + (:b "bold") + " text, with a leading & trailing space "))) + +(assert + (consp (parse-xml-file (merge-pathnames "test/xhtml-page.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :sxml))) + +(assert + (consp (parse-xml-file (merge-pathnames "test/ant-build-file.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :sxml))) + +(assert + (consp (parse-xml-file (merge-pathnames "test/plist.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :sxml))) + +(assert + (string-equal (print-xml-string '(:|foo|) :input-type :sxml) + "")) + +(assert + (string-equal (print-xml-string '(:|foo| (:@ (:|bar| "1"))) :input-type :sxml) + "")) + +(assert + (string-equal (print-xml-string '(:foo "some text") :input-type :sxml) + "some text")) + +(assert + (string-equal (print-xml-string '(:|foo| (:|bar|)) :input-type :sxml) + "")) + +;;;; eof \ No newline at end of file diff --git a/third_party/lisp/s-xml/test/test-xml-struct-dom.lisp b/third_party/lisp/s-xml/test/test-xml-struct-dom.lisp new file mode 100644 index 0000000000..f5ee1cc925 --- /dev/null +++ b/third_party/lisp/s-xml/test/test-xml-struct-dom.lisp @@ -0,0 +1,84 @@ +;;;; -*- mode: lisp -*- +;;;; +;;;; $Id: test-xml-struct-dom.lisp,v 1.2 2005/08/29 15:01:49 scaekenberghe Exp $ +;;;; +;;;; Unit and functional tests for xml-struct-dom.lisp +;;;; +;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. +;;;; +;;;; You are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser General Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +(in-package :s-xml) + +(assert + (xml-equal (with-input-from-string (stream " ") + (parse-xml stream :output-type :xml-struct)) + (make-xml-element :name :|foo|))) + +(assert + (xml-equal (parse-xml-string "this is some text" + :output-type :xml-struct) + (make-xml-element :name :|tag1| + :children (list (make-xml-element :name :|tag2| + :attributes '((:|att1| . "one"))) + "this is some text")))) + +(assert + (xml-equal (parse-xml-string "<foo>" + :output-type :xml-struct) + (make-xml-element :name :|tag| + :children (list "")))) + +(assert + (xml-equal (parse-xml-string + "

This is some bold text, with a leading & trailing space

" + :output-type :xml-struct) + (make-xml-element :name :p + :children (list (make-xml-element :name :index + :attributes '((:item . "one"))) + " This is some " + (make-xml-element :name :b + :children (list "bold")) + " text, with a leading & trailing space ")))) + +(assert + (xml-element-p (parse-xml-file (merge-pathnames "test/xhtml-page.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :xml-struct))) + +(assert + (xml-element-p (parse-xml-file (merge-pathnames "test/ant-build-file.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :xml-struct))) + +(assert + (xml-element-p (parse-xml-file (merge-pathnames "test/plist.xml" + (asdf:component-pathname + (asdf:find-system :s-xml.test))) + :output-type :xml-struct))) + +(assert + (string-equal (print-xml-string (make-xml-element :name "foo") + :input-type :xml-struct) + "")) + +(assert + (string-equal (print-xml-string (make-xml-element :name "foo" :attributes '((:|bar| . "1"))) + :input-type :xml-struct) + "")) + +(assert + (string-equal (print-xml-string (make-xml-element :name "foo" :children (list "some text")) + :input-type :xml-struct) + "some text")) + +(assert + (string-equal (print-xml-string (make-xml-element :name "foo" :children (list (make-xml-element :name "bar"))) + :input-type :xml-struct) + "")) + +;;;; eof \ No newline at end of file diff --git a/third_party/lisp/s-xml/test/test-xml.lisp b/third_party/lisp/s-xml/test/test-xml.lisp new file mode 100644 index 0000000000..daef58ea46 --- /dev/null +++ b/third_party/lisp/s-xml/test/test-xml.lisp @@ -0,0 +1,86 @@ +;;;; -*- mode: lisp -*- +;;;; +;;;; $Id: test-xml.lisp,v 1.3 2005/11/06 12:44:48 scaekenberghe Exp $ +;;;; +;;;; Unit and functional tests for xml.lisp +;;;; +;;;; Copyright (C) 2002, 2004 Sven Van Caekenberghe, Beta Nine BVBA. +;;;; +;;;; You are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser General Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. + +(in-package :s-xml) + +(assert + (whitespace-char-p (character " "))) + +(assert + (whitespace-char-p (character " "))) + +(assert + (whitespace-char-p (code-char 10))) + +(assert + (whitespace-char-p (code-char 13))) + +(assert + (not (whitespace-char-p #\A))) + +(assert + (char= (with-input-from-string (stream " ABC") + (skip-whitespace stream)) + #\A)) + +(assert + (char= (with-input-from-string (stream "ABC") + (skip-whitespace stream)) + #\A)) + +(assert + (string-equal (with-output-to-string (stream) (print-string-xml "" stream)) + "<foo>")) + +(assert + (string-equal (with-output-to-string (stream) (print-string-xml "' '" stream)) + "' '")) + +(assert + (let ((string (map 'string #'identity '(#\return #\tab #\newline)))) + (string-equal (with-output-to-string (stream) (print-string-xml string stream)) + string))) + +(defun simple-echo-xml (in out) + (start-parse-xml + in + (make-instance 'xml-parser-state + :new-element-hook #'(lambda (name attributes seed) + (declare (ignore seed)) + (format out "<~a~:{ ~a='~a'~}>" + name + (mapcar #'(lambda (p) (list (car p) (cdr p))) + (reverse attributes)))) + :finish-element-hook #'(lambda (name attributes parent-seed seed) + (declare (ignore attributes parent-seed seed)) + (format out "" name)) + :text-hook #'(lambda (string seed) + (declare (ignore seed)) + (princ string out))))) + +(defun simple-echo-xml-string (string) + (with-input-from-string (in string) + (with-output-to-string (out) + (simple-echo-xml in out)))) + +(dolist (*ignore-namespaces* '(nil t)) + (assert + (let ((xml "TextMore text!")) + (equal (simple-echo-xml-string xml) + xml)))) + +(assert + (let ((xml "

")) + (equal (simple-echo-xml-string xml) + xml))) + +;;;; eof \ No newline at end of file diff --git a/third_party/lisp/s-xml/test/xhtml-page.xml b/third_party/lisp/s-xml/test/xhtml-page.xml new file mode 100644 index 0000000000..79f3ae3bad --- /dev/null +++ b/third_party/lisp/s-xml/test/xhtml-page.xml @@ -0,0 +1,271 @@ + + + + + +XHTML Tutorial + + + + + + + + + + + + + + + + + + +
+
+HOME
+
+XHTML Tutorial
+XHTML HOME
+XHTML Introduction
+XHTML Why
+XHTML v HTML
+XHTML Syntax
+XHTML DTD
+XHTML HowTo
+XHTML Validation
+
+Quiz +
+XHTML Quiz
+
+References +
+XHTML Tag List
+XHTML Attributes
+XHTML Events
+
+ + + + +
+
+ +Corel XMetal 3 + + +
Please Visit Our Sponsors ! +
+

XHTML Tutorial

+Previous +Next + +
+ +

XHTML Tutorial

+

XHTML is the next generation of HTML! In our XHTML tutorial you will learn the difference between HTML and XHTML, and how to use XHTML in your future +applications. You will also see how we converted this Web site into XHTML. Start Learning +XHTML!

+ +

XHTML Quiz Test

+

Test your XHTML skills at W3Schools! Start XHTML +Quiz! 

+ +

XHTML References

+

At W3Schools you will find complete XHTML references about tags, attributes +and events. XHTML 1.0 References.

+
+

Table of Contents

+

Introduction to XHTML
+This chapter gives a brief introduction to XHTML and explains what XHTML is.

+

XHTML - Why?
+This chapter explains why we needed a new language like XHTML.

+

Differences between XHTML and HTML
+This chapter explains the main differences in syntax between XHTML and HTML.

+

XHTML Syntax 
+This chapter explains the basic syntax of XHTML.

+

XHTML DTD 
+This chapter explains the three different XHTML Document Type Definitions.

+

XHTML HowTo
+This chapter explains how this web site was converted from HTML to XHTML.

+

XHTML Validation
+This chapter explains how to validate XHTML documents.

+
+

XHTML References

+

XHTML 1.0 Reference
+
Our complete XHTML 1.0 reference is an alphabetical list of all XHTML tags +with lots of  examples and tips.

+

XHTML 1.0 Standard Attributes
+
All the tags have attributes. The attributes for each tag are listed in the +examples in the "XHTML 1.0 Reference" page. The attributes listed here +are the core and language attributes all the tags has as standard (with +few exceptions). This reference describes the attributes, and shows possible +values for each.

+

XHTML 1.0 Event Attributes
+
All the standard event attributes of the tags. This reference describes the attributes, and shows possible +values for each.

+
+Previous +Next + + +
+

+Jump to: Top of Page +or HOME or + +Printer Friendly +Printer friendly page +

+
+ +

Search W3Schools:

+
+ + + +
+ +
+

What Others Say About Us

+

Does the world know about us? Check out these places:

+

+Dogpile +Alta Vista +MSN +Google +Excite +Lycos +Yahoo +Ask Jeeves +

+
+

We Help You For Free. You Can Help Us!

+ + +
+

+W3Schools is for training only. We do not warrant its correctness or its fitness for use. +The risk of using it remains entirely with the user. While using this site, you agree to have read and accepted our +terms of use and +privacy policy.

+

+Copyright 1999-2002 by Refsnes Data. All Rights Reserved

+
+ + + + +
+ +Validate + +How we converted to XHTML + + +Validate +
+
+
+ + +

+ +Web charting +
+Web based charting
for ASP.NET
+ +

+
+ + +
+
+ +Your own Web Site?
+
Read W3Schools +
Hosting Tutorial
+
+
+
+ + +
+
+$15 Domain Name
Registration
Save $20 / year!
+
+
+
+ + + + +
+
+SELECTED LINKS +

+University Online
+Master Degree
Bachelor Degree
+

+Web Software +

+The Future of
Web Development
+

+Jobs and Careers +

+Web Security +
+Web Statistics +
+Web Standards +

+
+ + + + +
+
+ +Recommended
+Reading:


+ + +HTML XHTML + + +

+ + + +
+
+PARTNERS
+
+W3Schools
+TopXML
+VisualBuilder
+XMLPitstop
+DevelopersDex
+DevGuru
+Programmers Heaven
+The Code Project
+Tek Tips Forum
+ZVON.ORG
+TopXML Search
+
+
+
+ + + -- cgit 1.4.1