xmls-1.4.1/ 000755 000765 000000 00000000000 11532471004 012423 5 ustar 00rpg wheel 000000 000000 xmls-1.4.1/Changelog 000644 000765 000000 00000002734 11531625137 014252 0 ustar 00rpg wheel 000000 000000 # $Id: Changelog 620 2011-02-25 04:04:47Z rpgoldman $ 1.4.1 * Fixed bugs in parsing CDATA that could cause crashes in the parser.# 1.4 * Thanks to Norman Werner, fixed bug in handling of multi-byte characters. 1.3 * Bumped the version to record the presence of the helper functions. 1.2.1, 1.2.2 * Miscellaneous bugfixes, not recorded by anyone. 1.2 * add compilation guard around *whitespace* (5 million people) * generate-xml serializes numbers and symbols automatically (Robert Goldman) 1.1.1 * fix typo in test function guard 1.1 * merge Barry Wilkes patches for ws in attributes * merge Barry Wilkes lispworks compatibility patches * merge Gary King's MCL compatibilty patches * merge Clayton Wheeler's memory optimizations * merge Robert Goldman's Allegro fixes 1.0 * Parse/emit unprintables as entities. * Parse numeric xml entitites thanks to Damien Diederen. * Optionally indent write-xml output. * Fix namespace resolution bug 0.5 * Fix compress-whitespace handling. * Add Damien Diederen's entity-handling patch. 0.4 * Made substantial changes to get xmls working in cmucl and clisp. * Reduced consing again somewhat. 0.3 * Bugfix from Andrew Philpot. * Consing reduced by about 40%. 0.2 * Now skips DTDs. * Roughly seven times faster. * Parses CDATA sections. * Only uses one token of lookahead. * Handles content at the end of the document. 0.1 * First release. xmls-1.4.1/clnet-page.shtml 000644 000765 000000 00000004057 11500267762 015532 0 ustar 00rpg wheel 000000 000000
latest --> Better support for Unicode. | xmls-1.4 | source | signature | md5 | changelog |
xmls-1.3 | source | signature | md5 | ||
xmls-1.2 | source | signature | md5 | ||
xmls-1.1 | source | signature | md5 | ||
xmls-1.0 | source | signature | md5 |
There is no publicly-accessible source repository for XMLS. Please submit patches to the maintainer. The likelihood of getting patches doesn't justify the effort of maintaining such a source repository. If this is a real problem for you, please contact the maintainer and we will arrange to provide you access to the private repository.
xmls-1.4.1/COPYING 000644 000765 000000 00000002705 10122063105 013453 0 ustar 00rpg wheel 000000 000000 Copyright (c) 2003, Miles Egan All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. xmls-1.4.1/nst-tests.lisp 000644 000765 000000 00000002003 11531274046 015261 0 ustar 00rpg wheel 000000 000000 (defpackage xmls-nst (:nicknames xmls-test) (:use :common-lisp :nst :xmls) ) (in-package :xmls-nst) (def-test-group xmls-test () (def-test check-cdata-backtrack (:equalp (list "name" nil "x]")) (parse "Xmls is a small, simple, non-validating xml parser for Common Lisp. It's designed to be a self-contained, easily embedded parser that recognizes a useful subset of the XML spec. It provides a simple mapping from xml to lisp s-expressions and back.
Parsed xml is represented as a lisp list. A node is represented as follows:
(name (attributes) children*)
A name is either a simple string, if the element does not belong to a namespace, or a list of (name namespace-url) if the element does belong to a namespace.
Attributes are stored as (name value) lists.
Children are stored as a list of either element nodes or text nodes.
For example, the following xml document:
<?xml version="1.0"?> <!-- test document --> <book title='The Cyberiad'> <!-- comment in here --> <author xmlns='http://authors'>Stanislaw Lem</author> <info:subject xmlns:info='http://bookinfo' rank='1'>"Cybernetic Fables"</info:subject> </book>Would parse as:
("book" (("title" "The Cyberiad")) (("author" . "http://authors") NIL "Stanislaw Lem") (("subject" . "http://bookinfo") (("rank" "1")) "\"Cybernetic Fables\""))
Xmls also includes a helper function, make-node for creating xml nodes of this form:
(make-node &key name ns attrs children)
Xmls provides the corresponding accessor functions node-name, node-ns node-attrs, and node-children.
The interface is straightforward. The two main functions are parse and toxml.
(parse source &key (compress-whitespace t))
Parse accepts either a string or an input stream and attempts to parse the xml document contained therein. It will return the s-expr parse tree if it's successful or nil if parsing fails. If compress-whitespace is t, content nodes will be trimmed of whitespace and empty whitespace strings between nodes will be discarded.
(write-xml xml stream &key (indent nil))
write-xml accepts a lisp list in the format described above and writes the equivalent xml string to stream. Currently, if nodes use namespaces xmls will not assign namespaces prefixes but will explicitly assign the namespace to each node. This will be changed in a later release. Xmls will indent the generated xml output if indent is non-nil.
(toxml node &key (indent nil))
Toxml is a convenience wrapper around write-xml that returns the in a newly allocated string.
These are intended to allow programmers to avoid direct manipulation of the s-expression representation. If you use these, your code should be easier to read and you will avoid problems if there is a change in internal representation (such changes would be hard to even find, much less correct, if using the lists directly).
make-xmlrep (tag &key attribs children)
xmlrep-add-child! (xmlrep child)
xmlrep-tag (xmlrep)
xmlrep-tagmatch (tag treenode)
xmlrep-attribs (xmlrep)
xmlrep-children (xmlrep)
xmlrep-find-child-tags (tag treenode)
xmlrep-tagmatch
.
xmlrep-find-child-tag (tag treenode
&optional (if-unfound :error))
xmlrep-attrib-value (attrib treenode
&optional (if-undefined :error))
xmlrep-boolean-attrib-value (attrib treenode
&optional (if-undefined :error))
xmls can be installed as an asdf system. An asdf system definition is provided with the distribution.
Previous versions of XMLS were single files, and could be installed simply by loading the file xmls.lisp. This option is no longer supported.
Please contact Robert Goldman, rpgoldman AT sift.info with any questions or bug reports.
xmls-1.4.1/run-tests.sh 000755 000765 000000 00000004155 11500265652 014740 0 ustar 00rpg wheel 000000 000000 #!/bin/sh # $Id: run-tests.sh 578 2010-12-09 23:52:10Z rpgoldman $ FORM="(xmls::test)" SEPARATOR="" usage () { cat <