Common Lisp Package: STP-QUERY

README:

FUNCTION

Public

ADD-CLASS (ELTS CLASS-NAME)

Adds the specified class(es) to each of the set of matched elements.

ATTR (ELTS ATTRIBUTE-NAME)

Get the value of an attribute for the first element in the set of matched elements.

CHILDREN (ELTS &OPTIONAL SELECTOR)

Get the children of each element in the set of matched elements, optionally filtered by a selector.

CLOSEST (ELTS SELECTOR)

Get the first element that matches the selector, beginning at the current element and progressing up through the DOM tree.

CONTENTS (ELTS)

Get the children of each element in the set of matched elements, including text and comment nodes.

EACH (ELTS FN &REST ARGS)

Iterate over a set of elements, executing a function for each matched element.

FILTER (ELTS &OPTIONAL SELECTOR)

Reduce the set of matched elements to those that match the selector or pass the function's test.

FIND (ELTS &OPTIONAL SELECTOR)

Get the descendants of each element in the current set of matched elements, filtered by a selector.

FIRST (ELTS)

Reduce the set of matched elements to the first in the set.

HAS-CLASS (ELTS CLASS-NAME)

Determine whether any of the matched elements are assigned the given class.

MAP (ELTS FN &REST ARGS)

Pass each element in the current matched set through a function, producing a new object containing the return values.

NEXT (ELTS &OPTIONAL SELECTOR)

Get the immediately following sibling of each element in the set of matched elements. If a selector is provided, it retrieves the next sibling only if it matches that selector.

NEXT-ALL (ELTS &OPTIONAL SELECTOR)

Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.

NOT (ELTS &OPTIONAL SELECTOR)

Reduce the set of matched elements to those that match the selector or pass the function's test.

PARENT (ELTS &OPTIONAL SELECTOR)

Get the parent of each element in the current set of matched elements, optionally filtered by a selector.

PARENTS (ELTS &OPTIONAL SELECTOR)

Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector.

PREV (ELTS &OPTIONAL SELECTOR)

Get the immediately preceding sibling of each element in the set of matched elements, optionally filtered by a selector.

PREV-ALL (ELTS &OPTIONAL SELECTOR)

Get all preceding siblings of each element in the set of matched elements, optionally filtered by a selector.

REMOVE-ATTR (ELTS ATTRIBUTE-NAME)

Remove an attribute from each element in the set of matched elements.

REMOVE-CLASS (ELTS CLASS-NAME)

Remove a single class, multiple classes, or all classes from each element in the set of matched elements.

SIBLINGS (ELTS &OPTIONAL SELECTOR)

Get the siblings of each element in the set of matched elements, optionally filtered by a selector.

SLICE (ELTS START &OPTIONAL END)

Reduce the set of matched elements to a subset specified by a range of indices.

TOGGLE-CLASS (ELTS CLASS-NAME &OPTIONAL (SWITCH NIL SWITCH-P))

Add or remove one or more classes from each element in the set of matched elements, depending on either the class's presence or the value of the switch argument.

VAL (ELTS)

Get the current value of the first element in the set of matched elements.

Undocumented

ANCESTORS (ELTS)

COMPILE-CSS-NODE-MATCHER (SELECTOR)

ESCAPE-XML (TEXT)

HTML (ELTS)

NODE-MATCHES? (NODE SELECTOR)

PARSE-RESULTS (&OPTIONAL (INP #foo, .foo #bar .bast, .foo > bar[src~=blech], .foo:hover))

QUERY (SELECTOR &OPTIONAL (ELTS *DOCUMENT*))

TEXT (ELTS)

Private

ALL-GROUP-MATCHES-AS-STRING (REGEX TARGET)

Expects a single matching group

DOS-SAFE-READ-LINE (STREAM &OPTIONAL (EOF-ERROR-P T) EOF-VALUE RECURSIVE-P)

readline that can read unix or dos lines

HANDLE-QUOTED-RULES (PRODUCTION)

quotes in flex productions should be direct string matches

MAKE-ATTRIB-MATCHER (ATTRIB MATCH-TYPE MATCH-TO)

attrib-matcher

REPLACE-ALL (STRING PART REPLACEMENT &KEY (TEST #'CHAR=) STREAM)

Returns a new string in which all the occurences of the part is replaced with replacement. [FROM http://cl-cookbook.sourceforge.net/strings.html#manip]

STRCAT* (STRING-DESIGNATORS)

Concatenate all the strings in STRING-DESIGNATORS.

TRIM-AND-NULLIFY (S)

trims the whitespace from a string returning nil if trimming produces an empty string or the string 'nil'

Undocumented

%NODE-MATCHES? (NODE SELECTOR)

%RULE (ARGS BODY)

%RULE-SET (NAME RULES)

ARG-LIST-VAR-NAMES (ARGS)

ATTRIB-INCLUDES? (NODE ATTRIB VALUE)

BUT-FIRST (S)

BUT-LAST (S)

BUT-QUOTES (S)

CLASS-NAMES (ELT)

CLOSE-OVER (ELTS FN)

EXPAND-RETURN-VALUE (RTN)

IS-SPECIAL? (S)

JOIN-WORDS (WORDS)

KEYWORDIZE (S)

LEX-RESULTS (&OPTIONAL (INP #foo, .foo #bar, .foo > bar[src~=blech]))

MAKE-AND-MATCHER (FORMS)

MAKE-CHILD-MATCHER (PARENT-MATCHER CHILD-MATCHER)

MAKE-CLASS-MATCHER (CLASS)

MAKE-CSS3-LEXER (INP)

MAKE-ELT-MATCHER (TAG)

MAKE-HASH-MATCHER (ID)

MAKE-IMMEDIATE-CHILD-MATCHER (PARENT-MATCHER CHILD-MATCHER)

MAKE-IMMEDIATLY-PRECEDED-BY-MATCHER (THIS-MATCHER SIBLING-MATCHER)

MAKE-MATCHER-AUX (TREE)

MAKE-NODE-MATCHER (EXPRESSION)

MAKE-NTH-PSEUDO-MATCHER (PSEUDO MUL ADD)

MAKE-OR-MATCHER (FORMS)

MAKE-PRECEDED-BY-MATCHER (THIS-MATCHER SIBLING-MATCHER)

MAKE-PSEUDO-MATCHER (PSEUDO SUBMATCHER)

NEXT-ELEMENT (ELT &OPTIONAL (FN #'NEXT-SIBLING))

PREV-ELEMENT (ELT)

READ-FLEX-FILE (FILE &AUX CI? (DEFS (MAKE-HASH-TABLE TEST 'EQUALP)) DONE-WITH-DEFS?)

REPLACE-EXPANSIONS (DEFS NEW-REGEX)

SPLIT-WORDS (STRING)

STRING-UPCASE? (S)

SYMBOLIZE (S)

TRIM-WHITESPACE (S)

UNIQUIFY-AND-REINTERN (X &OPTIONAL (PACKAGE *PACKAGE*))

MACRO

Public

Undocumented

FOREACH ((ELT ELTS) &BODY BODY)

Private

Undocumented

LAM (ARGS &BODY BODY)

RULE (ARGS &BODY BODY)

RULE-SET (NAME &BODY RULES)

VARIABLE

Private

*IGNORE-NAMESPACES*

ignore tag name spaces when matching, for now the parser doesnt support parsing namespaced tags, so lets ignore tag namespaces

Undocumented

*CSS3-SELECTOR-PARSER*

*DOCUMENT*

+COMMON-WHITE-SPACE-TRIMBAG+

+CSS3-LEX-PRODUCTIONS+

+END-OF-DEFS+

+OPTION+

+OPTION-CASE-INSENSITIVE+

+RETURN-VALUE+