next up previous contents
Next: The match-anything matcher Up: The standard matchers Previous: The attr matcher   Contents


Character data--the pcdata matcher

The pcdata matcher matches ordinary text--just strings, the actual contents of tags. There are, of course, a number of constraints you can put on the values of the strings.

Syntax:

pcdata &key matches-regexp how-many test-fn possible-values type $\rightarrow$ matcher

Arguments and Values:

matches-regexp--a regular expression which the text must match. Note that ``^'' and ``$'' are not added to the start and end of the regular expression. This is inconsistant, I know. However, it is more conventient this way.

how-many--a symbol indicating how many times the matcher can match children of its parent tag. One of:

  1. :one--matches one
  2. :one-or-more--matches one or more
  3. :zero-or-more--matches zero or more
  4. :zero-or-one--matches zero or one (an optional matcher, in other words)

test-fn--a designator for a function that takes the text as an argument and returns a boolean indicating whether or not the text should be matched. This lets you use the full power of Common Lisp in your sanity checking.

possible-values--a list of strings that are all the possible values of the text.

type--a type specifier for the type of the pcdata's value when it has been read by the Common Lisp reader.

matcher--the matcher object returned.


next up previous contents
Next: The match-anything matcher Up: The standard matchers Previous: The attr matcher   Contents
root 2004-10-26