├── .gitignore ├── COPYING ├── README.md ├── buildnode-excel.asd ├── buildnode-html5.asd ├── buildnode-kml.asd ├── buildnode-xhtml.asd ├── buildnode-xul.asd ├── buildnode.asd ├── doc └── example.lisp ├── examples ├── excel.lisp ├── kml.lisp └── xhtml.lisp ├── src ├── buildnode.lisp ├── dom-walker.lisp ├── html-def.lisp ├── packages.lisp ├── tags │ ├── excel.lisp │ ├── html5-tags.lisp │ ├── kml.lisp │ ├── tags.lisp │ ├── xhtml-tags.lisp │ └── xul-tags.lisp ├── xhtml-lat1.ent ├── xhtml-special.ent ├── xhtml-symbol.ent └── xhtml1-transitional.dtd └── tests ├── basic-tests.lisp └── setup.lisp /.gitignore: -------------------------------------------------------------------------------- 1 | .svn 2 | build 3 | dist 4 | *~ 5 | *# 6 | *.fasl 7 | bin/gainesville-green.com 8 | etc/apache.conf 9 | etc/init.d 10 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Acceleration.net (http://www.acceleration.net), 2 | Russ Tyndall , Ryan Davis, Nathan Bird 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in the 14 | documentation and/or other materials provided with the 15 | distribution. 16 | 17 | * Neither the name of the Acceleration.net nor the names of its 18 | contributors may be used to endorse or promote products derived 19 | from this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 22 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 23 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 24 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 25 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 26 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 27 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 28 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 29 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 31 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Buildnode: A libary to ease interaction with cxml:dom documents and nodes 2 | 3 | ## Examples 4 | 5 | Please see the examples directory for runable examples in each XML dialect 6 | 7 | ## Primary Goals 8 | * To define packages of functions that can generate specific xml 9 | dialects (see the src/tags directory and associated asd files). 10 | 11 | * To add iterate drivers for various dom interactions 12 | 13 | * To provide a reasonable base of funcationality for smoothing 14 | common dom interactions such as: 15 | * adding, removing, moving nodes 16 | * adjusting attributes and values 17 | * adjusting css classes 18 | 19 | * To provide a flexible tool for programatically generating 20 | and manipulating various and sundry xml formats 21 | 22 | ## Authors 23 | * [Acceleration.net](http://www.acceleration.net/) [Donate](http://www.acceleration.net/programming/donate-to-acceleration-net/) 24 | * [Russ Tyndall](http://russ.unwashedmeme.com/blog) 25 | * [Nathan Bird](http://the.unwashedmeme.com/blog) 26 | * [Ryan Davis](http://ryepup.unwashedmeme.com/blog) 27 | 28 | 29 | ``` 30 | ;; Copyright (c) 2011 Russ Tyndall , Acceleration.net http://www.acceleration.net 31 | ;; All rights reserved. 32 | ;; 33 | ;; Redistribution and use in source and binary forms, with or without 34 | ;; modification, are permitted provided that the following conditions are 35 | ;; met: 36 | ;; 37 | ;; - Redistributions of source code must retain the above copyright 38 | ;; notice, this list of conditions and the following disclaimer. 39 | ;; 40 | ;; - Redistributions in binary form must reproduce the above copyright 41 | ;; notice, this list of conditions and the following disclaimer in the 42 | ;; documentation and/or other materials provided with the distribution. 43 | ;; 44 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 45 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 46 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 47 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 48 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 49 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 50 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 51 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 52 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 53 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 54 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 55 | ``` -------------------------------------------------------------------------------- /buildnode-excel.asd: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | (eval-when (:compile-toplevel :load-toplevel :execute) 4 | (unless (find-package :net.acceleration.buildnode.system) 5 | (defpackage :net.acceleration.buildnode.system 6 | (:use :common-lisp :asdf)))) 7 | 8 | (in-package :net.acceleration.buildnode.system) 9 | 10 | (defsystem :buildnode-excel 11 | :description "Tool for building up an xml dom of an excel spreadsheet nicely. 12 | Uses this XML format: 13 | http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx 14 | " 15 | :components 16 | ((:module :src 17 | :serial T 18 | :components 19 | ((:module :tags 20 | :serial T 21 | :components 22 | ((:file "excel")))))) 23 | :depends-on (:buildnode)) 24 | -------------------------------------------------------------------------------- /buildnode-html5.asd: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | (eval-when (:compile-toplevel :load-toplevel :execute) 4 | (unless (find-package :net.acceleration.buildnode.system) 5 | (defpackage :net.acceleration.buildnode.system 6 | (:use :common-lisp :asdf)))) 7 | 8 | (in-package :net.acceleration.buildnode.system) 9 | 10 | (defsystem :buildnode-html5 11 | :description "Tool for building up an xml dom of an html5 document" 12 | :components 13 | ((:module :src 14 | :serial T 15 | :components 16 | ((:module :tags 17 | :serial T 18 | :components 19 | ((:file "html5-tags")))))) 20 | :depends-on (:buildnode)) -------------------------------------------------------------------------------- /buildnode-kml.asd: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | (eval-when (:compile-toplevel :load-toplevel :execute) 4 | (unless (find-package :net.acceleration.buildnode.system) 5 | (defpackage :net.acceleration.buildnode.system 6 | (:use :common-lisp :asdf)))) 7 | 8 | (in-package :net.acceleration.buildnode.system) 9 | 10 | (defsystem :buildnode-kml 11 | :description "Tool for building up an xml dom of an KML." 12 | :components 13 | ((:module :src 14 | :serial T 15 | :components 16 | ((:module :tags 17 | :serial T 18 | :components 19 | ((:file "kml")))))) 20 | :depends-on (:buildnode)) 21 | -------------------------------------------------------------------------------- /buildnode-xhtml.asd: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | (eval-when (:compile-toplevel :load-toplevel :execute) 4 | (unless (find-package :net.acceleration.buildnode.system) 5 | (defpackage :net.acceleration.buildnode.system 6 | (:use :common-lisp :asdf)))) 7 | 8 | (in-package :net.acceleration.buildnode.system) 9 | 10 | (defsystem :buildnode-xhtml 11 | :description "Tool for building up an xml dom of an excel spreadsheet nicely." 12 | :components 13 | ((:module :src 14 | :serial T 15 | :components 16 | ((:module :tags 17 | :serial T 18 | :components 19 | ((:file "xhtml-tags")))))) 20 | :depends-on (:buildnode)) -------------------------------------------------------------------------------- /buildnode-xul.asd: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | (eval-when (:compile-toplevel :load-toplevel :execute) 4 | (unless (find-package :net.acceleration.buildnode.system) 5 | (defpackage :net.acceleration.buildnode.system 6 | (:use :common-lisp :asdf)))) 7 | 8 | (in-package :net.acceleration.buildnode.system) 9 | 10 | (defsystem :buildnode-xul 11 | :description "Tool for building up an xml dom of a Mozilla xul document" 12 | :components 13 | ((:module :src 14 | :serial T 15 | :components 16 | ((:module :tags 17 | :serial T 18 | :components 19 | ((:file "xul-tags")))))) 20 | :depends-on (:buildnode)) -------------------------------------------------------------------------------- /buildnode.asd: -------------------------------------------------------------------------------- 1 | ;; -*- lisp -*- 2 | 3 | (eval-when (:compile-toplevel :load-toplevel :execute) 4 | (unless (find-package :net.acceleration.buildnode.system) 5 | (defpackage :net.acceleration.buildnode.system 6 | (:use :common-lisp :asdf)))) 7 | 8 | (in-package :net.acceleration.buildnode.system) 9 | 10 | (defsystem :buildnode 11 | :description "Tool for building up an xml dom nicely." 12 | :author "http://www.acceleration.net" 13 | :licence "BSD" 14 | :components 15 | ((:module :src 16 | :serial T 17 | :components 18 | ((:file "packages") 19 | ;; should be removed once a patch doing the same thing makes its 20 | ;; way upstream 21 | (:file "dom-walker") 22 | (:file "buildnode") 23 | (:module :tags 24 | :serial T 25 | :components ((:file "tags" )))))) 26 | :depends-on (:cxml :alexandria 27 | :iterate :flexi-streams :split-sequence 28 | :swank ;; for setting tag-indentation 29 | :cl-interpol 30 | :collectors 31 | ;; TODO: 32 | ;; for html-generation - probably not a dependancy of the whole library 33 | :closure-html 34 | :cl-ppcre 35 | :symbol-munger 36 | )) 37 | 38 | (defsystem :buildnode-test 39 | :description ":buildnode-test: tests for buildnode library of code" 40 | :author "http://www.acceleration.net" 41 | :licence "BSD" 42 | :components 43 | ((:module :tests 44 | :serial t 45 | :components ((:file "setup") 46 | (:file "basic-tests")))) 47 | :depends-on (:buildnode :buildnode-xhtml :lisp-unit2)) 48 | 49 | (defmethod asdf:perform ((o asdf:test-op) (c (eql (find-system :buildnode)))) 50 | (asdf:load-system :buildnode-test) 51 | (let ((*package* (find-package :buildnode-test))) 52 | (eval (read-from-string "(run-tests)")))) 53 | 54 | ;; Copyright (c) 2011 Russ Tyndall , Acceleration.net http://www.acceleration.net 55 | ;; All rights reserved. 56 | ;; 57 | ;; Redistribution and use in source and binary forms, with or without 58 | ;; modification, are permitted provided that the following conditions are 59 | ;; met: 60 | ;; 61 | ;; - Redistributions of source code must retain the above copyright 62 | ;; notice, this list of conditions and the following disclaimer. 63 | ;; 64 | ;; - Redistributions in binary form must reproduce the above copyright 65 | ;; notice, this list of conditions and the following disclaimer in the 66 | ;; documentation and/or other materials provided with the distribution. 67 | ;; 68 | ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 69 | ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 70 | ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 71 | ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 72 | ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 73 | ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 74 | ;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 75 | ;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 76 | ;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 77 | ;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 78 | ;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /doc/example.lisp: -------------------------------------------------------------------------------- 1 | (in-package :buildnode) 2 | 3 | (with-document-to-file "foo.xul" 4 | (?xml-stylesheet "chrome://global/skin/" ) 5 | (?xml-stylesheet "/css/MC.css" ) 6 | (xul:window '(:title "MC Administration" 7 | :onload "asdf") 8 | (xhtml:div '() (xhtml:div)) 9 | (xul:script '(:type "text/javascript" :src "/JSControls/JSHelper.js")) 10 | (xul:label '(:class "h1") "MobileCampus Administration") 11 | (xul:vbox '(:flex "1") 12 | (xul:hbox '(:flex "1"))))) 13 | 14 | ; 15 | ; 16 | ; 21 | ;