Common Lisp Package: XMLS

README:

FUNCTION

Public

MAKE-NODE (&KEY NAME NS ATTRS CHILD CHILDREN)

Convenience function for creating a new xml node.

PARSE (S &KEY (COMPRESS-WHITESPACE T))

Parses the supplied stream or string into a lisp node tree.

TOXML (E &KEY (INDENT NIL))

Renders a lisp node tree to an xml string.

WRITE-XML (E S &KEY (INDENT NIL))

Renders a lisp node tree to an xml stream. Indents if indent is non-nil.

XMLREP-ATTRIB-VALUE (ATTRIB TREENODE &OPTIONAL (IF-UNDEFINED ERROR))

Find the value of ATTRIB, a string, in TREENODE. if there is no ATTRIB, will return the value of IF-UNDEFINED, which defaults to :ERROR.

XMLREP-BOOLEAN-ATTRIB-VALUE (ATTRIB TREENODE &OPTIONAL (IF-UNDEFINED ERROR))

Find the value of ATTRIB, a string, in TREENODE. The value should be either "true" or "false". The function will return T or NIL, accordingly. If there is no ATTRIB, will return the value of IF-UNDEFINED, which defaults to :ERROR.

XMLREP-FIND-CHILD-TAG (TAG TREENODE &OPTIONAL (IF-UNFOUND ERROR))

Find a single child of TREENODE with TAG. Returns an error if there is more or less than one such child.

XMLREP-FIND-CHILD-TAGS (TAG TREENODE)

Find all the children of TREENODE with TAG.

Undocumented

MAKE-XMLREP (TAG &KEY ATTRIBS CHILDREN)

NODE-ATTRS (ELEM)

SETFNODE-ATTRS (ATTRS ELEM)

NODE-CHILDREN (ELEM)

SETFNODE-CHILDREN (CHILDREN ELEM)

NODE-NAME (ELEM)

NODE-NS (ELEM)

SETFNODE-NS (NS ELEM)

XMLREP-ADD-CHILD! (XMLREP CHILD)

XMLREP-ATTRIBS (TREENODE)

XMLREP-CHILDREN (TREENODE)

XMLREP-INTEGER-CHILD (TREENODE)

XMLREP-STRING-CHILD (TREENODE)

XMLREP-TAG (TREENODE)

XMLREP-TAGMATCH (TAG TREENODE)

Private

ELEMENT-TYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ELEMENT-VAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

ESCAPE-FOR-HTML (STRING)

Escapes the characters #\<, #\>, #\', #\", and #\& for HTML output.

GENERATE-XML (E S INDENT)

Renders a lisp node tree to an xml string stream.

MAKE-EXTENDABLE-STRING (&OPTIONAL (SIZE 10))

Creates an adjustable string with a fill pointer.

NONE-OR-MORE (S FUNC)

Collects any matches of the supplied rule with the input stream.

ONE-OR-MORE (S FUNC)

Collects one or more matches of the supplied rule with the input stream.

PEEK-STREAM (STREAM)

Looks one character ahead in the input stream. Serves as a potential hook for character translation.

PUSH-STRING (C STRING)

Shorthand function for adding characters to an extendable string.

READ-STREAM (STREAM)

Reads a character from the stream, translating entities as it goes.

RESOLVE-ENTITY (ENT)

Resolves the xml entity ENT to a character. Numeric entities are converted using CODE-CHAR, which only works in implementations that internally encode strings in US-ASCII, ISO-8859-1 or UCS.

RESOLVE-NAMESPACE (ELEM ENV)

Maps the ns prefix to its associated url via the supplied ns env.

STATE-GOT-DOCTYPE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

STATE-LINES (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

STATE-NSSTACK (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

STATE-STREAM (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

TRANSLATE-RAW-VALUE (RAW-VALUE)

Helper function for xml generation.

Undocumented

ATTR-OR-NSDECL (S)

ATTR-TEXT-DQ (C)

ATTR-TEXT-SQ (C)

CHARDATA (C)

COMMENT (S)

COMMENT-CHAR (C)

COMMENT-OR-CDATA (S)

COMMENT-OR-DOCTYPE (S)

COMPRESS-WHITESPACE (STR)

CONTENT (S)

COPY-ELEMENT (INSTANCE)

COPY-STATE (INSTANCE)

DIGIT (C)

DOCUMENT (S)

ELEMENT (S)

ELEMENT-P (OBJECT)

SETFELEMENT-TYPE (NEW-VALUE INSTANCE)

SETFELEMENT-VAL (NEW-VALUE INSTANCE)

END-TAG (S)

LETTER (C)

MAKE-ELEMENT (&KEY ((TYPE DUM499) NIL) ((VAL DUM500) NIL))

MAKE-STATE (&KEY ((GOT-DOCTYPE DUM321) NIL) ((LINES DUM322) 1) ((NSSTACK DUM323) NIL) ((STREAM DUM324) NIL))

MISC (S)

NAME (S)

NAMECHAR (C)

NCNAME (S)

NCNAME-CHAR (C)

PROCESSING-INSTRUCTION (S)

PROCESSING-INSTRUCTION-OR-XMLDECL (S)

QNAME (S)

START-TAG (S)

SETFSTATE-GOT-DOCTYPE (NEW-VALUE INSTANCE)

SETFSTATE-LINES (NEW-VALUE INSTANCE)

SETFSTATE-NSSTACK (NEW-VALUE INSTANCE)

STATE-P (OBJECT)

SETFSTATE-STREAM (NEW-VALUE INSTANCE)

TEST

WRITE-ESCAPED (STRING STREAM)

WS (S)

WS-ATTR-OR-NSDECL (S)

WS-CHAR (C)

XMLDECL (S)

MACRO

Private

DEFMATCH (NAME &REST BODY)

Match definition macro that provides a common lexical environment for matchers.

DEFRULE (NAME &REST BODY)

Rule definition macro that provides a common lexical environment for rules.

EAT

Consumes one character from the input stream.

MATCH (&REST MATCHERS)

Attempts to match the next input character with one of the supplied matchers.

MATCH* (&REST SEQUENCE)

Matches any occurances of any of the supplied matchers.

MATCH+ (&REST SEQUENCE)

Matches one or more occurances of any of the supplied matchers.

MATCH-SEQ (&REST SEQUENCE)

Tries to match the supplied matchers in sequence with characters in the input stream.

MATCHFN (NAME)

Convenience macro for creating an anonymous function wrapper around a matcher macro.

MUST (&REST BODY)

Throws a parse error if the supplied forms do not succeed.

PEEK (&REST MATCHERS)

Looks ahead for an occurance of any of the supplied matchers.

PUKE (CHAR)

The opposite of EAT.

GENERIC-FUNCTION

Private

Undocumented

ERROR-LINE (CONDITION)

VARIABLE

Private

Undocumented

*CHAR-ESCAPES*

*COMPRESS-WHITESPACE*

*ENTITIES*

*STRIP-COMMENTS*

*TEST-VERBOSE*

*WHITESPACE*

CLASS

Private

ELEMENT (S)

Common return type of all rule functions.

STATE

Represents parser state. Passed among rules to avoid threading issues.

CONDITION

Private

Undocumented

XML-PARSE-ERROR