This is the xpath Reference Manual, version 0.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:18:11 2024 GMT+0.
xpath/xpath.asd
xpath/package.lisp
xpath/utils.lisp
xpath/pipes.lisp
xpath/protocol.lisp
xpath/xnum-ieee.lisp
xpath/types.lisp
xpath/extensions.lisp
xpath/environment.lisp
xpath/axes.lisp
xpath/node-tests.lisp
xpath/xpath.lisp
xpath/functions.lisp
xpath/lexer.lisp
xpath/parser.lisp
xpath/api.lisp
xpath/plx.lisp
xpath/xmls-compat.lisp
xpath/patterns.lisp
xpath/profile.lisp
The main system appears first, followed by any subsystem dependency.
xpath
An implementation of the XML Path Language (XPath) Version 1.0
Sharp Lispers <sharplispers@googlegroups.com>
Ivan Shvedunov
David Lichteblau
2 clause BSD
0.1
cxml
(system).
parse-number
(system).
cl-ppcre
(system).
yacc
(system).
package.lisp
(file).
utils.lisp
(file).
pipes.lisp
(file).
protocol.lisp
(file).
xnum-ieee.lisp
(file).
types.lisp
(file).
extensions.lisp
(file).
environment.lisp
(file).
axes.lisp
(file).
node-tests.lisp
(file).
xpath.lisp
(file).
functions.lisp
(file).
lexer.lisp
(file).
parser.lisp
(file).
api.lisp
(file).
plx.lisp
(file).
xmls-compat.lisp
(file).
patterns.lisp
(file).
profile.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
xpath/xpath.asd
xpath/package.lisp
xpath/utils.lisp
xpath/pipes.lisp
xpath/protocol.lisp
xpath/xnum-ieee.lisp
xpath/types.lisp
xpath/extensions.lisp
xpath/environment.lisp
xpath/axes.lisp
xpath/node-tests.lisp
xpath/xpath.lisp
xpath/functions.lisp
xpath/lexer.lisp
xpath/parser.lisp
xpath/api.lisp
xpath/plx.lisp
xpath/xmls-compat.lisp
xpath/patterns.lisp
xpath/profile.lisp
xpath/utils.lisp
package.lisp
(file).
xpath
(system).
concat
(function).
hypsym
(function).
maybe-progn
(function).
mklist
(function).
once-only
(macro).
proper-list-p
(function).
string-replace
(function).
trim
(function).
with-cache
(macro).
with-gensyms
(macro).
xpath/pipes.lisp
utils.lisp
(file).
xpath
(system).
%append-pipes
(function).
append-pipes
(macro).
empty-pipe
(constant).
enumerate
(function).
filter-pipe
(function).
find-in-pipe
(function).
find-in-pipe-if
(function).
force
(function).
make-pipe
(macro).
map-pipe
(function).
map-pipe-filtering
(function).
mappend-pipe
(function).
mappend-pipe-filtering
(function).
pipe-elt
(function).
pipe-empty-p
(function).
pipe-head
(function).
pipe-length
(function).
pipe-tail
(function).
subpipe-after
(function).
subpipe-before
(function).
xpath/protocol.lisp
pipes.lisp
(file).
xpath
(system).
*navigator*
(special variable).
attribute-pipe
(function).
attribute-pipe-using-navigator
(generic function).
base-uri
(function).
base-uri-using-navigator
(generic function).
child-pipe
(function).
child-pipe-using-navigator
(generic function).
define-default-method
(macro).
get-element-by-id
(function).
get-element-by-id-using-navigator
(generic function).
hash-key
(function).
hash-key-using-navigator
(generic function).
local-name
(function).
local-name-using-navigator
(generic function).
namespace-pipe
(function).
namespace-pipe-using-navigator
(generic function).
namespace-prefix
(function).
namespace-prefix-using-navigator
(generic function).
namespace-uri
(function).
namespace-uri-using-navigator
(generic function).
node-equal
(function).
node-equal-using-navigator
(generic function).
node-p
(function).
node-p-using-navigator
(generic function).
node-text
(function).
node-text-using-navigator
(generic function).
node-type-p
(function).
node-type-p-using-navigator
(generic function).
parent-node
(function).
parent-node-using-navigator
(generic function).
processing-instruction-target
(function).
processing-instruction-target-using-navigator
(generic function).
qualified-name
(function).
qualified-name-using-navigator
(generic function).
unparsed-entity-uri
(function).
unparsed-entity-uri-using-navigator
(generic function).
copy-dom-namespace
(function).
dom-namespace
(structure).
dom-namespace-p
(function).
dom-namespace-parent
(reader).
(setf dom-namespace-parent)
(writer).
dom-namespace-prefix
(reader).
(setf dom-namespace-prefix)
(writer).
dom-namespace-uri
(reader).
(setf dom-namespace-uri)
(writer).
make-dom-namespace
(function).
parent-pipe
(function).
vector->pipe
(function).
xpath/xnum-ieee.lisp
protocol.lisp
(file).
xpath
(system).
+nan+
(special variable).
compare-numbers
(function).
finite-p
(function).
fmod
(function).
inf-p
(function).
long-to-double
(function).
nan-p
(function).
parse-xnum
(function).
preprocess-number-str
(function).
round-to-integer
(function).
with-float-traps-masked
(macro).
x-minusp
(function).
x-plusp
(function).
x-zerop
(function).
xnum
(type).
xnum-*
(function).
xnum-+
(function).
xnum--
(function).
xnum-/
(function).
xnum->string
(function).
xnum-ceiling
(function).
xnum-floor
(function).
xnum-mod
(function).
xnum-p
(function).
xnum-round
(function).
xpath/types.lisp
xnum-ieee.lisp
(file).
xpath
(system).
boolean-value
(function).
context
(class).
context-node
(function).
(setf context-node)
(function).
context-position
(function).
(setf context-position)
(function).
context-size
(function).
(setf context-size)
(function).
context-starting-node
(function).
(setf context-starting-node)
(function).
make-context
(function).
node-set
(class).
node-set-empty-p
(function).
node-set-p
(function).
node-set-value
(function).
number-value
(function).
print-object
(method).
sort-node-set
(function).
string-value
(function).
compare-node-sets
(function).
compare-values
(function).
compare-with-node-set
(function).
compare/no-node-sets
(function).
get-node-id
(function).
get-node-index
(function).
get-node-text
(function).
make-node-set
(function).
node<
(function).
ordering-of
(reader method).
(setf ordering-of)
(writer method).
pipe-of
(function).
(setf pipe-of)
(function).
sort-nodes
(function).
sort-pipe
(function).
sorted-pipe-of
(function).
textually-first-node
(function).
xpath/extensions.lisp
types.lisp
(file).
xpath
(system).
%define-extension
(function).
%define-xpath-function/eager
(macro).
*extensions*
(special variable).
add-xpath-function
(function).
arg-count
(function).
compile-xpath-function-call
(function).
copy-extension
(function).
copy-xpath-function
(function).
define-extension
(macro).
define-xpath-function/eager
(macro).
define-xpath-function/lazy
(macro).
define-xpath-function/single-type
(macro).
extension
(structure).
extension-documentation
(reader).
(setf extension-documentation)
(writer).
extension-functions
(reader).
(setf extension-functions)
(writer).
extension-p
(function).
extension-uri
(reader).
(setf extension-uri)
(writer).
find-xpath-function
(function).
make-extension
(function).
make-xpath-function
(function).
xpath-function
(structure).
xpath-function-compiler
(reader).
(setf xpath-function-compiler)
(writer).
xpath-function-max-args
(reader).
(setf xpath-function-max-args)
(writer).
xpath-function-min-args
(reader).
(setf xpath-function-min-args)
(writer).
xpath-function-name
(reader).
(setf xpath-function-name)
(writer).
xpath-function-p
(function).
xpath/environment.lisp
extensions.lisp
(file).
xpath
(system).
with-namespaces
(macro).
with-variables
(macro).
%namespace-binding-pair
(function).
%variable-binding-pair
(function).
*dynamic-namespaces*
(special variable).
*dynamic-var-bindings*
(special variable).
*initial-namespaces*
(special variable).
copy-dynamic-environment
(function).
copy-environment
(function).
copy-test-environment
(function).
decode-dynamic-qname
(function).
dynamic-environment
(structure).
dynamic-environment-namespaces
(reader).
(setf dynamic-environment-namespaces)
(writer).
dynamic-environment-p
(function).
environment
(structure).
environment-find-function
(generic function).
environment-find-namespace
(generic function).
environment-find-variable
(generic function).
environment-p
(function).
find-dynamic-namespace
(function).
make-dynamic-environment
(function).
make-environment
(function).
make-test-environment
(function).
test-environment
(structure).
test-environment-p
(function).
xpath/axes.lisp
environment.lisp
(file).
xpath
(system).
axis-ancestor
(function).
axis-ancestor-or-self
(function).
axis-attribute
(function).
axis-child
(function).
axis-descendant
(function).
axis-descendant-or-self
(function).
axis-following
(function).
axis-following-sibling
(function).
axis-function
(function).
axis-namespace
(function).
axis-parent
(function).
axis-preceding
(function).
axis-preceding-sibling
(function).
axis-principal-node-type
(function).
axis-properties
(function).
axis-reverse-descendant-or-self
(function).
axis-root
(function).
axis-self
(function).
define-axis
(macro).
xpath/node-tests.lisp
axes.lisp
(file).
xpath
(system).
node-test-comment
(function).
node-test-name
(function).
node-test-namespace
(function).
node-test-node
(function).
node-test-principal
(function).
node-test-processing-instruction
(function).
node-test-text-node
(function).
xpath/xpath.lisp
node-tests.lisp
(file).
xpath
(system).
compile-filter-path
(function).
compile-location-step
(function).
compile-node-test
(function).
compile-path
(function).
compile-predicates
(function).
compile-variable
(function).
compile-xpath/sexpr
(function).
decode-qname
(function).
find-namespace
(function).
make-location-path
(function).
make-location-step
(function).
xf-location-path
(function).
xf-true
(function).
xf-value
(function).
xpath/functions.lisp
xpath.lisp
(file).
xpath
(system).
get-lang-attribute
(function).
xf-and
(function).
xf-equal
(function).
xf-or
(function).
xfd-*
(function).
xfd-+
(function).
xfd--
(function).
xfd-/
(function).
xfd-/=
(function).
xfd-<
(function).
xfd-<=
(function).
xfd-=
(function).
xfd->
(function).
xfd->=
(function).
xfd-and
(function).
xfd-boolean
(function).
xfd-ceiling
(function).
xfd-concat
(function).
xfd-contains
(function).
xfd-count
(function).
xfd-false
(function).
xfd-floor
(function).
xfd-id
(function).
xfd-lang
(function).
xfd-last
(function).
xfd-local-name
(function).
xfd-mod
(function).
xfd-name
(function).
xfd-namespace-uri
(function).
xfd-normalize-space
(function).
xfd-not
(function).
xfd-number
(function).
xfd-or
(function).
xfd-position
(function).
xfd-round
(function).
xfd-starts-with
(function).
xfd-string
(function).
xfd-string-length
(function).
xfd-substring
(function).
xfd-substring-after
(function).
xfd-substring-before
(function).
xfd-sum
(function).
xfd-translate
(function).
xfd-true
(function).
xfd-union
(function).
xpath/lexer.lisp
functions.lisp
(file).
xpath
(system).
define-fixup-lexer
(macro).
deflexer
(macro).
make-fixup-lexer
(function).
namep
(function).
nc-name-p
(function).
xpath-lexer
(function).
xpath/parser.lisp
lexer.lisp
(file).
xpath
(system).
parse-xpath
(function).
*xpath-parser*
(special variable).
lambda*
(macro).
make-function-name
(function).
xpath/api.lisp
parser.lisp
(file).
xpath
(system).
all-nodes
(function).
compile-xpath
(function).
do-node-set
(macro).
evaluate
(compiler macro).
evaluate
(function).
evaluate-compiled
(function).
first-node
(function).
list->node-set
(function).
make-node-set-iterator
(function).
map-node-set
(function).
map-node-set->list
(function).
node-set-iterator-current
(function).
node-set-iterator-end-p
(function).
node-set-iterator-next
(function).
xpath
(macro).
xpath-error
(function).
xpath-error
(condition).
%make-node-set-iterator
(function).
copy-node-set-iterator
(function).
map-node-sets->list
(macro).
namespaces-match-p
(function).
node-set-iterator
(structure).
node-set-iterator-p
(function).
node-set-iterator-pipe
(reader).
(setf node-set-iterator-pipe)
(writer).
same-expr-p
(function).
xpath-expr
(type).
xpath/plx.lisp
api.lisp
(file).
xpath
(system).
with-plx-extensions
(macro).
*plx-uri*
(special variable).
define-regex-function
(macro).
xfd-current
(function).
xfd-generate-id
(function).
xfd-matches
(function).
xfd-replace
(function).
xpath/xmls-compat.lisp
plx.lisp
(file).
xpath
(system).
attribute-pipe-using-navigator
(method).
attribute-pipe-using-navigator
(method).
attribute-pipe-using-navigator
(method).
attribute-pipe-using-navigator
(method).
base-uri-using-navigator
(method).
child-pipe-using-navigator
(method).
child-pipe-using-navigator
(method).
child-pipe-using-navigator
(method).
child-pipe-using-navigator
(method).
get-element-by-id-using-navigator
(method).
hash-key-using-navigator
(method).
hash-key-using-navigator
(method).
local-name-using-navigator
(method).
local-name-using-navigator
(method).
local-name-using-navigator
(method).
local-name-using-navigator
(method).
namespace-pipe-using-navigator
(method).
namespace-pipe-using-navigator
(method).
namespace-pipe-using-navigator
(method).
namespace-pipe-using-navigator
(method).
namespace-prefix-using-navigator
(method).
namespace-prefix-using-navigator
(method).
namespace-uri-using-navigator
(method).
namespace-uri-using-navigator
(method).
namespace-uri-using-navigator
(method).
namespace-uri-using-navigator
(method).
node-equal-using-navigator
(method).
node-equal-using-navigator
(method).
node-equal-using-navigator
(method).
node-equal-using-navigator
(method).
node-p-using-navigator
(method).
node-p-using-navigator
(method).
node-p-using-navigator
(method).
node-p-using-navigator
(method).
node-p-using-navigator
(method).
node-text-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
node-type-p-using-navigator
(method).
parent-node-using-navigator
(method).
qualified-name-using-navigator
(method).
qualified-name-using-navigator
(method).
qualified-name-using-navigator
(method).
unparsed-entity-uri-using-navigator
(method).
xmls-attribute
(structure).
xmls-attribute-local-name
(reader).
(setf xmls-attribute-local-name)
(writer).
xmls-attribute-uri
(reader).
(setf xmls-attribute-uri)
(writer).
xmls-attribute-value
(reader).
(setf xmls-attribute-value)
(writer).
xmls-namespace
(structure).
xmls-namespace-parent
(reader).
(setf xmls-namespace-parent)
(writer).
xmls-namespace-uri
(reader).
(setf xmls-namespace-uri)
(writer).
xpath/patterns.lisp
xmls-compat.lisp
(file).
xpath
(system).
*allow-variables-in-patterns*
(special variable).
compute-patterns
(function).
make-pattern-matcher
(function).
make-pattern-matcher*
(function).
matching-value
(function).
matching-values
(function).
node-matches-p
(compiler macro).
node-matches-p
(function).
parse-pattern-expression
(function).
pattern
(structure).
pattern-case
(macro).
pattern-ecase
(macro).
pattern-priority
(reader).
(setf pattern-priority)
(writer).
pattern-value
(reader).
(setf pattern-value)
(writer).
%compile-subpattern
(function).
%make-pattern
(function).
compile-pattern-expression
(function).
compile-pattern-expression/sexpr
(function).
compile-subpattern
(function).
copy-pattern
(function).
make-reverse-location-path
(function).
make-reverse-location-step
(function).
make-reverse-predicate-check
(function).
node-type
(function).
pattern-expr
(type).
pattern-expression
(reader).
(setf pattern-expression)
(writer).
pattern-key
(reader).
(setf pattern-key)
(writer).
pattern-p
(function).
pattern-thunk
(reader).
(setf pattern-thunk)
(writer).
step-key
(function).
subpattern-key
(function).
valid-expression-p
(function).
xpath/profile.lisp
patterns.lisp
(file).
xpath
(system).
*profiling-enabled-p*
(special variable).
*samples*
(special variable).
disable-profiling
(function).
enable-profiling
(function).
group-and-sort-samples
(function).
maybe-wrap-profiling
(function).
report
(function).
report-xpath
(function).
report-xpattern
(function).
stringify-pattern-expression
(function).
stringify-pattern-expressions
(function).
wrap-profiling
(function).
write-node-test
(function).
Packages are listed by definition order.
xpath
Plexippus XPath is an XPath 1.0 implementation for Common Lisp.
@begin[Using XPath]{section}
Almost all uses of XPath involve the @code{evaluate} function, which
can parse, compile, and invoke XPath expressions.
@aboutfun{evaluate}
@aboutmacro{xpath}
@end{section}
@begin[Compiling XPath dynamically]{section}
@code{compile-xpath} allows the compilation of XPath into a closure
ahead of time, so that @code{evaluate} only needs to invoke that closure
rather than having to re-compile it first.
Although @code{evaluate} itself already performs caching of compiled
closures, explicit precompilation can aid optimizations if one
call site uses multiple XPath expressions.
Explicit compilation using @code{compile-xpath} is also required when
using custom environment classes, since @code{evaluate} compiles
expressions using the dynamic environment only.
@code{parse-xpath} can be used to translate the standard string
representation of XPath into a Plexippus-specific sexp representation.
Both @code{compile-xpath} and @code{evaluate} accept sexps instead of
strings.
@aboutfun{parse-xpath}
@aboutfun{compile-xpath}
@end{section}
@begin[Type coercion]{section}
These correspond to the XPath functions boolean(),
string(), and number(). In addition, @code{node-set-value}
is provided, which turns nodes into node sets.
@aboutfun{boolean-value}
@aboutfun{string-value}
@aboutfun{number-value}
@aboutfun{node-set-value}
@end{section}
@begin[The dynamic environment]{section}
The default enviroment used by @code{evaluate} is the dynamic
environment, backed by information bound in dynamic variables.
The following macros are used to bind these variables. They have
dynamic scope. (The dynamic environment is currently not capable
of dynamic declarations for variables, but can be used with extension
functions that are declared globally.)
(The XPATH-SYS defined an @a[xpath-sys.html]{environment protocol}
for user-defined environment classes.)
@aboutmacro{with-namespaces}
@aboutmacro{with-variables}
@end{section}
@begin[The run-time context]{section}
Instead of passing a node to @code{evaluate}, user code can construct
a full context object.
The context object specifies values to be returned by position(),
current(), and last().
@aboutclass{context}
@aboutfun{make-context}
@aboutfun{context-node}
@aboutfun{context-starting-node}
@aboutfun{context-position}
@aboutfun{context-size}
@end{section}
@begin[Node sets]{section}
Node sets are the XPath data type used to represent the results of
evaluations that select multiple nodes. As sets, they never contain
duplicates.
In addition to the high-level functions defined here, the XPATH-SYS package defined several @a[xpath-sys.html]{low-level node set functions}. Please also refer to the description there for details on node set order.
@aboutfun{first-node}
@aboutfun{all-nodes}
@aboutfun{map-node-set}
@aboutfun{map-node-set->list}
@aboutmacro{do-node-set}
@aboutfun{make-node-set-iterator}
@aboutfun{node-set-iterator-end-p}
@aboutfun{node-set-iterator-next}
@aboutfun{node-set-iterator-current}
@aboutfun{node-set-p}
@aboutfun{node-set-empty-p}
@aboutfun{node-set}
@aboutfun{list->node-set}
@aboutfun{sort-node-set}
@end{section}
@begin[Miscellaneous]{section}
Other useful functions, variables, and classes:
@aboutmacro{with-plx-extensions}
@aboutvar{*navigator*}
@aboutclass{xpath-error}
@end{section}
common-lisp
.
xpath-utils
.
xpattern
.
*navigator*
(special variable).
all-nodes
(function).
boolean-value
(function).
compile-xpath
(function).
context
(class).
context-node
(function).
(setf context-node)
(function).
context-position
(function).
(setf context-position)
(function).
context-size
(function).
(setf context-size)
(function).
context-starting-node
(function).
(setf context-starting-node)
(function).
do-node-set
(macro).
evaluate
(compiler macro).
evaluate
(function).
evaluate-compiled
(function).
first-node
(function).
list->node-set
(function).
make-context
(function).
make-node-set-iterator
(function).
map-node-set
(function).
map-node-set->list
(function).
node-set
(class).
node-set-empty-p
(function).
node-set-iterator-current
(function).
node-set-iterator-end-p
(function).
node-set-iterator-next
(function).
node-set-p
(function).
node-set-value
(function).
number-value
(function).
parse-xpath
(function).
sort-node-set
(function).
string-value
(function).
with-namespaces
(macro).
with-plx-extensions
(macro).
with-variables
(macro).
xpath
(macro).
xpath-error
(function).
xpath-error
(condition).
%append-pipes
(function).
%compile-subpattern
(function).
%define-extension
(function).
%define-xpath-function/eager
(macro).
%make-node-set-iterator
(function).
%make-pattern
(function).
%namespace-binding-pair
(function).
%variable-binding-pair
(function).
*dynamic-namespaces*
(special variable).
*dynamic-var-bindings*
(special variable).
*extensions*
(special variable).
*initial-namespaces*
(special variable).
*plx-uri*
(special variable).
*profiling-enabled-p*
(special variable).
*samples*
(special variable).
*xpath-parser*
(special variable).
+nan+
(special variable).
add-xpath-function
(function).
append-pipes
(macro).
arg-count
(function).
axis-ancestor
(function).
axis-ancestor-or-self
(function).
axis-attribute
(function).
axis-child
(function).
axis-descendant
(function).
axis-descendant-or-self
(function).
axis-following
(function).
axis-following-sibling
(function).
axis-function
(function).
axis-namespace
(function).
axis-parent
(function).
axis-preceding
(function).
axis-preceding-sibling
(function).
axis-principal-node-type
(function).
axis-properties
(function).
axis-reverse-descendant-or-self
(function).
axis-root
(function).
axis-self
(function).
compare-node-sets
(function).
compare-numbers
(function).
compare-values
(function).
compare-with-node-set
(function).
compare/no-node-sets
(function).
compile-filter-path
(function).
compile-location-step
(function).
compile-node-test
(function).
compile-path
(function).
compile-pattern-expression
(function).
compile-pattern-expression/sexpr
(function).
compile-predicates
(function).
compile-subpattern
(function).
compile-variable
(function).
compile-xpath-function-call
(function).
compile-xpath/sexpr
(function).
copy-dom-namespace
(function).
copy-dynamic-environment
(function).
copy-environment
(function).
copy-extension
(function).
copy-node-set-iterator
(function).
copy-pattern
(function).
copy-test-environment
(function).
copy-xpath-function
(function).
decode-dynamic-qname
(function).
decode-qname
(function).
define-axis
(macro).
define-extension
(macro).
define-fixup-lexer
(macro).
define-regex-function
(macro).
define-xpath-function/eager
(macro).
define-xpath-function/lazy
(macro).
define-xpath-function/single-type
(macro).
deflexer
(macro).
disable-profiling
(function).
dom-namespace
(structure).
dom-namespace-p
(function).
dom-namespace-parent
(reader).
(setf dom-namespace-parent)
(writer).
dom-namespace-prefix
(reader).
(setf dom-namespace-prefix)
(writer).
dom-namespace-uri
(reader).
(setf dom-namespace-uri)
(writer).
dynamic-environment
(structure).
dynamic-environment-namespaces
(reader).
(setf dynamic-environment-namespaces)
(writer).
dynamic-environment-p
(function).
empty-pipe
(constant).
enable-profiling
(function).
enumerate
(function).
environment
(structure).
environment-find-function
(generic function).
environment-find-namespace
(generic function).
environment-find-variable
(generic function).
environment-p
(function).
expression
(slot).
extension
(structure).
extension-documentation
(reader).
(setf extension-documentation)
(writer).
extension-functions
(reader).
(setf extension-functions)
(writer).
extension-p
(function).
extension-uri
(reader).
(setf extension-uri)
(writer).
filter-pipe
(function).
find-dynamic-namespace
(function).
find-in-pipe
(function).
find-in-pipe-if
(function).
find-namespace
(function).
find-xpath-function
(function).
finite-p
(function).
fmod
(function).
force
(function).
get-lang-attribute
(function).
get-node-id
(function).
get-node-index
(function).
get-node-text
(function).
group-and-sort-samples
(function).
inf-p
(function).
key
(slot).
lambda*
(macro).
long-to-double
(function).
make-dom-namespace
(function).
make-dynamic-environment
(function).
make-environment
(function).
make-extension
(function).
make-fixup-lexer
(function).
make-function-name
(function).
make-location-path
(function).
make-location-step
(function).
make-node-set
(function).
make-pipe
(macro).
make-reverse-location-path
(function).
make-reverse-location-step
(function).
make-reverse-predicate-check
(function).
make-test-environment
(function).
make-xpath-function
(function).
map-node-sets->list
(macro).
map-pipe
(function).
map-pipe-filtering
(function).
mappend-pipe
(function).
mappend-pipe-filtering
(function).
maybe-wrap-profiling
(function).
namep
(function).
namespaces-match-p
(function).
nan-p
(function).
nc-name-p
(function).
node-set-iterator
(structure).
node-set-iterator-p
(function).
node-set-iterator-pipe
(reader).
(setf node-set-iterator-pipe)
(writer).
node-test-comment
(function).
node-test-name
(function).
node-test-namespace
(function).
node-test-node
(function).
node-test-principal
(function).
node-test-processing-instruction
(function).
node-test-text-node
(function).
node-type
(function).
node<
(function).
ordering-of
(generic reader).
(setf ordering-of)
(generic writer).
parent-pipe
(function).
parse-xnum
(function).
pattern-expr
(type).
pattern-expression
(reader).
(setf pattern-expression)
(writer).
pattern-key
(reader).
(setf pattern-key)
(writer).
pattern-p
(function).
pattern-thunk
(reader).
(setf pattern-thunk)
(writer).
pipe-elt
(function).
pipe-empty-p
(function).
pipe-head
(function).
pipe-length
(function).
pipe-of
(function).
(setf pipe-of)
(function).
pipe-tail
(function).
preprocess-number-str
(function).
priority
(slot).
report
(function).
report-xpath
(function).
report-xpattern
(function).
round-to-integer
(function).
same-expr-p
(function).
sort-nodes
(function).
sort-pipe
(function).
sorted-pipe-of
(function).
step-key
(function).
stringify-pattern-expression
(function).
stringify-pattern-expressions
(function).
subpattern-key
(function).
subpipe-after
(function).
subpipe-before
(function).
test-environment
(structure).
test-environment-p
(function).
textually-first-node
(function).
thunk
(slot).
valid-expression-p
(function).
value
(slot).
vector->pipe
(function).
with-float-traps-masked
(macro).
wrap-profiling
(function).
write-node-test
(function).
x-minusp
(function).
x-plusp
(function).
x-zerop
(function).
xf-and
(function).
xf-equal
(function).
xf-location-path
(function).
xf-or
(function).
xf-true
(function).
xf-value
(function).
xfd-*
(function).
xfd-+
(function).
xfd--
(function).
xfd-/
(function).
xfd-/=
(function).
xfd-<
(function).
xfd-<=
(function).
xfd-=
(function).
xfd->
(function).
xfd->=
(function).
xfd-and
(function).
xfd-boolean
(function).
xfd-ceiling
(function).
xfd-concat
(function).
xfd-contains
(function).
xfd-count
(function).
xfd-current
(function).
xfd-false
(function).
xfd-floor
(function).
xfd-generate-id
(function).
xfd-id
(function).
xfd-lang
(function).
xfd-last
(function).
xfd-local-name
(function).
xfd-matches
(function).
xfd-mod
(function).
xfd-name
(function).
xfd-namespace-uri
(function).
xfd-normalize-space
(function).
xfd-not
(function).
xfd-number
(function).
xfd-or
(function).
xfd-position
(function).
xfd-replace
(function).
xfd-round
(function).
xfd-starts-with
(function).
xfd-string
(function).
xfd-string-length
(function).
xfd-substring
(function).
xfd-substring-after
(function).
xfd-substring-before
(function).
xfd-sum
(function).
xfd-translate
(function).
xfd-true
(function).
xfd-union
(function).
xnum
(type).
xnum-*
(function).
xnum-+
(function).
xnum--
(function).
xnum-/
(function).
xnum->string
(function).
xnum-ceiling
(function).
xnum-floor
(function).
xnum-mod
(function).
xnum-p
(function).
xnum-round
(function).
xpath-expr
(type).
xpath-function
(structure).
xpath-function-compiler
(reader).
(setf xpath-function-compiler)
(writer).
xpath-function-max-args
(reader).
(setf xpath-function-max-args)
(writer).
xpath-function-min-args
(reader).
(setf xpath-function-min-args)
(writer).
xpath-function-name
(reader).
(setf xpath-function-name)
(writer).
xpath-function-p
(function).
xpath-lexer
(function).
xpath-protocol
XPATH-PROTOCOL package contains generic functions that are used to support multiple representations of XML documents for XPath.
attribute-pipe
(function).
attribute-pipe-using-navigator
(generic function).
base-uri
(function).
base-uri-using-navigator
(generic function).
child-pipe
(function).
child-pipe-using-navigator
(generic function).
define-default-method
(macro).
get-element-by-id
(function).
get-element-by-id-using-navigator
(generic function).
hash-key
(function).
hash-key-using-navigator
(generic function).
local-name
(function).
local-name-using-navigator
(generic function).
namespace-pipe
(function).
namespace-pipe-using-navigator
(generic function).
namespace-prefix
(function).
namespace-prefix-using-navigator
(generic function).
namespace-uri
(function).
namespace-uri-using-navigator
(generic function).
node-equal
(function).
node-equal-using-navigator
(generic function).
node-p
(function).
node-p-using-navigator
(generic function).
node-text
(function).
node-text-using-navigator
(generic function).
node-type-p
(function).
node-type-p-using-navigator
(generic function).
parent-node
(function).
parent-node-using-navigator
(generic function).
processing-instruction-target
(function).
processing-instruction-target-using-navigator
(generic function).
qualified-name
(function).
qualified-name-using-navigator
(generic function).
unparsed-entity-uri
(function).
unparsed-entity-uri-using-navigator
(generic function).
xpath-utils
common-lisp
.
concat
(function).
hypsym
(function).
maybe-progn
(function).
mklist
(function).
once-only
(macro).
proper-list-p
(function).
string-replace
(function).
trim
(function).
with-cache
(macro).
with-gensyms
(macro).
xpath-sys
The XPATH-SYS package provides an API for extensions to Plexippus XPath.
@begin[Pipes]{section}
Pipes are lazy lists, inspired by their implementation in
Norvig’s ’Paradigms of Artificial Intelligence Programming’.
@aboutmacro{make-pipe}
@aboutfun{pipe-head}
@aboutfun{pipe-tail}
@end{section}
@begin[Node sets]{section}
Node sets are the XPath data type used to represent the results of
evaluations that select multiple nodes. As sets, they never contain
duplicates. Conceptually, they are unordered, with the most important
order defined on them being the document order.
As a data structure though, node sets are backed by a pipe, and the order
of elements in that pipe is well-documented: By default, the pipe of
returned node sets is sorted into document order. When unordered
results are requested, the order is usually not specified, but in some
cases, are already sorted according to the axis being queried, which
is usually sorted either in document order,or in reverse document order.
See @fun{xpath:evaluate} for the @code{unordered} argument.
@aboutclass{node-set}
@aboutfun{make-node-set}
@aboutfun{pipe-of}
@end{section}
@begin[Implementing environments]{section}
Environments provide compilation-time configuration for XPath.
An environment is a CLOS object, which is queried by the compiler using
generic functions that users can implement on their own subclasses
of @class{xpath::environment}.
The default environment class implements a ‘dynamic’ environment, backed
by information bound in dynamic variables, so that typical uses of XPath
work without special environment classes.
@aboutfun{environment-find-namespace}
@aboutfun{environment-find-variable}
@aboutfun{environment-find-function}
@end{section}
@begin[Defining extension functions]{section}
XPath defines built-in functions in the empty namespace. Using
the extension API, user code can implement XPath functions addressed
using other namespaces.
@aboutmacro{define-extension}
@aboutmacro{define-xpath-function/lazy}
@aboutmacro{define-xpath-function/eager}
@aboutmacro{define-xpath-function/single-type}
@aboutfun{find-xpath-function}
@end{section}
@begin[Profiling support]{section}
The profiling facility records the run time of XPath evaluations
and pattern matching.
@aboutfun{enable-profiling}
@aboutfun{disable-profiling}
@aboutfun{report}
@end{section}
@begin[Miscellaneous functions]{section}
Other useful functions:
@aboutfun{get-node-id}
@end{section}
xpattern
The XPATTERN package implements pattern matching compatible with XSLT 1.0.
@begin[Utilities powered by pattern matchers]{section}
The following convenience functions and macros use patterns. They
are implemented using the lower-level functions listed below.
@aboutfun{node-matches-p}
@aboutmacro{pattern-case}
@aboutmacro{pattern-ecase}
@end{section}
@begin[Compiling pattern matchers dynamically]{section}
Pattern are represented as objects:
@aboutclass{pattern}
@aboutfun{pattern-value}
@aboutfun{pattern-priority}
Use @code{compute-patterns} to parse a pattern expression into
pattern objects:
@aboutfun{compute-patterns}
@code{make-pattern-matcher} builds a matcher functions from multiple
pattern objects. The matcher will find the highest-priority match
among them.
@aboutfun{make-pattern-matcher}
@aboutfun{make-pattern-matcher*}
@end{section}
@begin[Applying pattern matchers]{section}
To invoke a matcher created by @code{make-pattern-matcher}, use
@code{matching-value} or @code{matching-values}:
@aboutfun{matching-value}
@aboutfun{matching-values}
@end{section}
*allow-variables-in-patterns*
(special variable).
compute-patterns
(function).
make-pattern-matcher
(function).
make-pattern-matcher*
(function).
matching-value
(function).
matching-values
(function).
node-matches-p
(compiler macro).
node-matches-p
(function).
parse-pattern-expression
(function).
pattern
(structure).
pattern-case
(macro).
pattern-ecase
(macro).
pattern-priority
(reader).
(setf pattern-priority)
(writer).
pattern-value
(reader).
(setf pattern-value)
(writer).
Definitions are sorted by export status, category, package, and then by lexicographic order.
If set to T, predicates in patterns are permitted to reference variables
using $var syntax. If set to NIL, such variable references signal a
compilation-time error. The default is T. Bind this variable to NIL to
enable compatibility with XSLT 1.0.
@see{compute-patterns}
@arg[var]{symbol, a variable name}
@arg[node-set]{a @class{node-set}}
@arg[result]{a form}
@return{the result of evaluating @code{result}}
@short{Executes @code{body} with @code{var} bound to successive nodes
in @code{node-set}}
The operation is performed lazily, i.e. if it’s terminated via
a non-local exit it doesn’t necessarily cause the XPath engine to find
out all nodes in the @class{node-set} internally.
Returns nil if @code{result} form isn’t specified.
@arg[node]{any node implementing the XPath protocol}
@arg[clauses]{cases of the form (expression &rest body)}
@return{The value returned by the matching clause body, or nil.}
@short{Match a node against static expressions.}
Evaluates @code{node}, and matches them against the specified XSLT
patterns. The first matching pattern will be chosen, i.e. earlier
clauses have higher priority that later clauses.
Expressions are compiled using the dynamic environment.
As a special case, the last expression can be @code{t}, in which case
it matches unconditionally.
@see{with-namespaces}
@see{pattern-ecase}
@see{node-matches-p}
@see{with-variables}
@arg[node]{any node implementing the XPath protocol}
@arg[clauses]{cases of the form (expression &rest body)}
@return{The value returned by the matching clause body.}
@short{Match a node against static expressions.}
Evaluates @code{node}, and matches them against the specified XSLT
patterns. The first matching pattern will be chosen, i.e. earlier
clauses have higher priority that later clauses.
Expressions are compiled using the dynamic environment.
If no clause matches, an error will be signalled.
@see{with-namespaces}
@see{pattern-case}
@see{node-matches-p}
@see{with-variables}
Execute the body binding syms to gensyms
@arg[bindings]{bindings in the form (PREFIX VALUE). PREFIXes and VALUEs are evaluated}
@return{the tresult of evaluating @code{body}}
@short{Provides namespace bindings for XPath compilation}
Namespace bindings are used for compilation of XPath expressions.
nil is equivalent of "" prefix. Bindings provided by this macro
have dynamic scope.
@short{Binds plx prefix to Plexippus XPath extensions namespace.}
The following functions are currently available:
@pre{plx:matches(string, pattern, flags?)}
Returns true if @code{string} is matched by regular expression @code{pattern},
false otherwise. Optional @code{flags} specify modifiers (i, m, s). CL-PPCRE
is used as regular expression engine.
@pre{plx:replace(string, pattern, replacement, flags?)}
Returns @code{string} with all matches of regular expression @code{pattern}
replaced with @code{replacement}. Optional @code{flags} specify modifiers
(i, m, s).
@pre{plx:current()}
Returns a @class{node-set} consisting of one node which was specifed
as context node for expression evaluation. Analagous to @code{current()}
function of XSLT.
@pre{plx:generate-id(node-set?)}
Returns an alphanumeric string that uniquely identifies the first node of
the @code{node-set} (or context node if @code{node-set} isn’t specified)
within its document. Analagous to @code{generate-id()} of XSLT (except
that the latter works across multiple documents).
@arg[bindings]{bindings in the form (QNAME VALUE). QNAMEs and VALUEs are evaluated}
@return{the tresult of evaluating @code{body}}
@short{Provides bindings for XPath variables}
Variable bindings are used for evaluation of compiled XPath expressions. Bindings provided by this macro have dynamic scope.
@arg[form]{a sexpr-based XPath form}
@return{a list consisting of symbol XPATH and the @code{form}}
This macro is used to specify sexpr-based XPath expression for @fun{evaluate}
@arg[node-set]{a @class{node-set}}
@return{a list of nodes}
Returns all nodes of the @code{node-set} as a list.
@arg[value]{value of an XPath-supported type or an XML node}
@return{an XPath boolean}
@short{Returns the value of XPath boolean() function.}
For XML nodes returns the value of XPath boolean() function applied
to the result of calling @fun{string-value} for the specified @code{value}.
@arg[xpath]{an XPath expression}
@return{a compiled XPath expression}
@short{Compiles an XPath expression}
The @code{xpath} expression is compiled using current environment if it isn’t compiled yet. @code{xpath} can be a string, a sexpr-based XPath epression or a compiled expression. In the latter case @code{xpath} argument value itself is returned.
@arg[expression]{a string or s-expression}
@arg[priority]{an integer}
@arg[value]{an object}
@arg[environment]{an @code{environment}}
@return{a list of @class{pattern}s}
@short{Parse an XSLT pattern expression into one or more pattern objects.}
Parses an expression, resolves its namespace-, variable-, and
function-references using the specified @code{environment}, and creates
a @class{pattern} object for the expression (if it does not use a union)
or one @class{pattern} object for each sub-expression that is being
joined into the union.
The specified @code{priority} is used as the @fun{pattern-priority},
and the specified @code{value} is used as the @fun{pattern-value}.
@see{make-pattern-matcher*}
@see{make-pattern-matcher}
Concatenate string representations (PRINC-TO-STRING) of VALUES
@arg[context]{an XPath context}
@return{an XML node}
Returns the context node of the XPath @code{context}.
@arg[node]{an XML node}
@arg[context]{an XPath context}
@return{the @code{node}}
Sets the context node of @code{context} and returns that node.
@arg[context]{an XPath context}
@return{a positive integer}
Returns the current position of the XPath @code{context}.
@arg[position]{context position, a positive integer}
@arg[context]{an XPath context}
@return{the value of @code{position}}
Sets the position of the XPath @code{context} and returns it.
@arg[context]{an XPath context}
@return{a non-negative number}
@short{Returns the size of @code{context}}
If the context size was specified as a function,
the result of calling that function is returned.
@arg[size]{context size, a non-negative integer or a function without arguments returning non-negative integer}
@arg[context]{an XPath context}
@return{the value of @code{size}}
Sets the size of the XPath @code{context} and returns it.
@arg[context]{an XPath context}
@return{an XML node}
Returns the node for which the whole XPath expression is evaluated.
@arg[context]{an XPath context}
@return{the value of @code{node}}
Sets the node which is considered "starting" one, i.e. for which the whole
XPath extension is evaluated.
@arg[xpath]{an XPath expression}
@arg[context]{an XPath context}
@arg[unordered-p]{specify true to get unordered node-set}
@return{the result of evaluating @code{xpath} within the @code{context}}
@short{Evaluates an XPath expression}
@code{xpath} can be a string, a sexpr-based XPath epression or
a compiled expression. The @code{context} can be obtained using @fun{make-context}.
As an alternative, a node can be specifed.
If @code{unordered-p} is false (default) and value being returned is a @class{node-set},
it will be sorted using @fun{sort-node-set} so its nodes will be in document
order. If @code{unordered-p} is true, the order of the nodes is unspecified.
Unordered mode can be significantly faster in some cases (and never slower).
@arg[compiled-xpath]{a compiled XPath expression}
@arg[context]{an XPath context}
@arg[unordered-p]{specify true to get unordered node-set}
@return{the result of evaluating @code{compiled-xpath} within the @code{context}}
@short{Evaluates a compiled XPath expression returned by @fun{compile-xpath}}
The @code{context} can be obtained using @fun{make-context}. As an alternative,
a node can be specifed.
If @code{unordered-p} is false (default) and value being returned is a @class{node-set},
it will be sorted using @fun{sort-node-set} so its nodes will be in document
order. If @code{unordered-p} is true, the order of the nodes is unspecified.
Unordered mode can be significantly faster in some cases (and never slower).
@arg[node-set]{a @class{node-set}}
@return{a @class{node-set} or nil}
Returns the first node in the @code{node-set} or nil if it’s empty.
Assemble a symbol from PARTS interleaving them with hyphens
@arg[list]{a list of nodes}
@return{a @class{node-set}}
Makes a @class{node-set} from the @code{list} of nodes.
@arg[node]{an XML node}
@arg[size]{context size, a non-negative integer or a function without arguments returning non-negative integer}
@arg[position]{context position, a positive integer}
Makes a @class{context} object.
@arg[node-set]{a @class{node-set}}
@return{a node-set iterator}
@short{Creates a node set iterator for @code{node-set}}
Node set iterators can be used to iterate over node-sets. This can be done without causing the XPath engine to find out all their nodes and using non-local exits.
@arg[patterns]{a list of @class{pattern}s}
@return{the pattern matcher, a function}
@short{Create a pattern matcher that distinguishes between
multiple patterns.}
This function combines several patterns, and creates a matcher function
for use with @fun{matching-value} or @fun{matching-values}.
The matcher function will compare a node against each pattern, and
find the highest-priority pattern or patterns that match the node.
@see{compute-patterns}
@arg[expression]{a string or s-expression}
@arg[environment]{an @code{environment}}
@return{the pattern matcher, a function}
@short{Create a pattern matcher for a single pattern.}
This function is a convenience wrapper around @fun{compute-patterns}
and @fun{make-pattern-matcher}.
The resulting matcher will return T if the specified @code{expression}
matches, or NIL if it doesn’t.
@see{compute-patterns}
@see{matching-value}
@see{matching-values}
@arg[func]{a function}
@arg[node-set]{a @class{node-set}}
@return{nil}
@short{Calls @code{func} for each node in @code{node-set}}
The operation is performed lazily, i.e. if it’s terminated via
a non-local exit it doesn’t necessarily cause the XPath engine to find
out all nodes in the @class{node-set} internally.
@arg[func]{a function}
@arg[node-set]{a @class{node-set}}
@return{a list}
@short{Calls @code{func} for each node in @code{node-set} and conses up
a list of its return values}
The operation is performed lazily, i.e. if it’s terminated via
a non-local exit it doesn’t necessarily cause the XPath engine to find
out all nodes in the @class{node-set} internally.
@arg[matcher]{a pattern matching function}
@arg[node]{any node implementing the XPath protocol}
@arg[default]{an object}
@return{an object}
@short{Apply a pattern matcher to node, and return exactly one value.}
For use with @code{matcher} functions that have been returned by
@fun{make-pattern-matcher} or a higher-level function like
@fun{make-pattern-matcher*}.
If exactly one pattern matches, or several patterns for the same value
match, the user-specified values as determined by @fun{pattern-value}
will be returned by this function.
If no pattern matches, @code{default} will be returned instead.
If more than one pattern of highest priority and different values
match, an @code{xpath-error} will be signalled.
@see{node-matches-p}
@see{pattern-case}
@see{pattern-ecase}
@arg[matcher]{a pattern matching function}
@arg[node]{any node implementing the XPath protocol}
@return{an object}
@short{Apply a pattern matcher to node, and return one or more matching
values.}
For use with @code{matcher} functions that have been returned by
@fun{make-pattern-matcher} or a higher-level function like
@fun{make-pattern-matcher*}.
The resulting list will contain the user-specified values as
returned by @fun{pattern-value} on the patterns for this matcher, in
any order. Duplicates under @code{eql} will have been removed from
the list.
@see{node-matches-p}
@see{pattern-case}
@see{pattern-ecase}
Wrap the BODY with PROGN if it contains more than one form. Otherwise return the first form or NIL if the body is empty
@arg[node]{any node implementing the XPath protocol}
@arg[pattern-expression]{a string or s-expression}
@return{a boolean}
@short{Determine whether @code{node} matches the pattern expression.}
The expression is compiled using the dynamic environment.
@see{with-namespaces}
@see{with-variables}
@see{pattern-case}
@see{pattern-ecase}
@arg[node-set]{a @class{node-set}} @return{a generalized boolean} Returns true if @code{node-set} is empty
@arg[iterator]{a node-set iterator returned by @fun{make-node-set-iterator}}
@return{a node or nil}
Returns current node of @code{iterator} or nil if it’s at the end
of its node set.
@arg[iterator]{a node-set iterator returned by @fun{make-node-set-iterator}}
@return{a generalized boolean}
Returns true if @code{iterator} points to the end of its node set
@arg[iterator]{a node-set iterator returned by @fun{make-node-set-iterator}}
@return{the value of @code{iterator}}
Advances @code{iterator} if it’s not at the end of its node set,
does nothing otherwise.
@arg[object]{a value of any type}
@return{a generalized boolean}
Returns true if @code{object} is a @class{node-set}
@arg[value]{value of an XPath-supported type or an XML node}
@return{a @class{node-set}}
@short{Returns the value of XPath node-set() function.}
For XML nodes returns a @class{node-set} consisting of the single node specified by @code{value}.
@arg[value]{value of an XPath-supported type or an XML node}
@return{an XPath number}
@short{Returns the value of XPath number() function.}
For XML nodes returns the value of XPath number() function applied
to the result of calling @fun{string-value} for the specified @code{value}.
@arg[str]{a string}
@return{a s-expression-based pattern expression}
Parses an XSLT pattern into an s-expression.
@arg[str]{a string}
@return{a s-expression-based XPath expression}
Parses a string-based XPath expression into s-expression-based one.
@arg[instance]{a @class{pattern}}
@return{an integer}
@short{Return the priority of this pattern.}
When several patters would match the same node, the pattern matcher
will only consider the patterns that have the highest priority.
@see{matching-value}
@see{matching-values}
@arg[instance]{a @class{pattern}}
@return{an object}
Return the user-specified value that will be returned by pattern
matchers if this pattern matches.
@see{matching-value}
@see{matching-values}
True if the LIST is proper list
@arg[node-set]{a @class{node-set}}
@return{a sorted version of @code{node-set}}
Sorts the @code{node-set} according to document order.
Replace occurences of SUBSTRING in STRING with REPLACEMENT.
@arg[value]{value of an XPath-supported type or an XML node}
@return{an XPath string}
@short{Returns the value of XPath number() function.}
For XML nodes returns the value of @fun{xpath-protocol:node-text} applied to the specified @code{value}.
@arg[fmt]{format control string}
@arg[args]{format arguments}
Signals the @class{xpath-error} condition with specified message.
Represents a parsed XSLT pattern. @see-constructor{compute-patterns} @see-slot{pattern-value} @see-slot{pattern-priority} @see{make-pattern-matcher}
Represents XPath context
Represents an XPath node set
@see-constructor{make-node-set}
return a pipe that appends two pipes.
The evaluation style of this macro has been chosen to be consistent with MAKE-PIPE: The first argument is evaluated eagerly; the second argument lazily.
@arg[name]{the name of XPath extension (a symbol)}
@arg[uri]{URI corresponding to XPath extension (a string)}
@arg[documentation]{documentation string for the XPath extension}
@short{Defines an XPath extension with specified @code{name} and @code{uri}.}
An XPath extension is a collection of XPath functions that are defined
using one of @fun{define-xpath-function/lazy},
@fun{define-xpath-function/eager} or @fun{define-xpath-function/single-type}
macros. In order to use the extension, one must bind a prefix string to
its @code{uri} using @fun{with-namespaces} macro.
Example:
@begin{pre}
(defparameter *my-namespace* "http://example.net/my-xpath-extension")
(xpath-sys:define-extension
my-ext *my-namespace*
"My Extension")
(xpath-sys:define-xpath-function/single-type my-ext add-quotes string (string)
(concat "\"" string "\""))
(defun get-my-quoted-string(doc)
(with-namespaces (("my" *my-namespace*))
(evaluate "add-quotes(//some-element)" doc)))
@end{pre}
@arg[ext]{name of an XPath extension (a symbol)}
@arg[name]{XPath function name}
@arg[args]{XPath function arguments}
@short{Defines an XPath function, "eager" style.}
The @code{body} is evaluated during evaluation of XPath
expressions each time the function being defined is called.
It’s passed a list of values corresponding to XPath function arguments
and should return a value of one of XPath types (string, boolean, number,
node set).
Example:
@begin{pre}
(define-xpath-function/eager my-ext join (delim node-set)
(reduce (lambda (a b) (concatenate ’string a delim b))
(map-node-set->list #’string-value node-set)))
@end{pre}
@see{define-xpath-extension}
@see{define-xpath-function/lazy}
@see{define-xpath-function/single-type}
@arg[ext]{name of an XPath extension (a symbol)}
@arg[name]{XPath function name}
@arg[args]{XPath function arguments}
@short{Defines an XPath function, "lazy" style.}
The @code{body} is evaluated during compilation of XPath
expressions each time the function being defined is referenced.
It’s passed a list of "thunks" corresponding to XPath function arguments
and should return a new "thunk". A "thunk" is a function that takes
an XPath @class{context} as argument and returns value of one of XPath
types (string, boolean, number, node set).
Example:
@begin{pre}
(define-xpath-function/lazy my-ext my-if (v if-part else-part)
#’(lambda (ctx)
(if (boolean-value (funcall v ctx))
(funcall if-part ctx)
(funcall else-part ctx))))
@end{pre}
@see{define-xpath-extension}
@see{define-xpath-function/eager}
@see{define-xpath-function/single-type}
@arg[ext]{name of an XPath extension (a symbol)}
@arg[name]{XPath function name}
@arg[args]{XPath function arguments}
@short{Defines an XPath function, "eager" style with automatic type conversion.}
The @code{body} is evaluated during evaluation of XPath
expressions each time the function being defined is called.
It’s passed a list of values corresponding to XPath function arguments
and should return a value of one of XPath types (string, boolean, number,
node set). Argument values are automatically converted to specified XPath @code{type}.
Example:
@begin{pre}
(xpath-sys:define-xpath-function/single-type my-ext add-quotes string (string)
(concat "\"" string "\""))
@end{pre}
@see{define-xpath-extension}
@see{define-xpath-function/lazy}
@see{define-xpath-function/eager}
@arg[head]{pipe head (evaluated)}
@arg[tail]{tail expression}
@return{a pipe}
@short{Constructs a pipe (lazy list).}
The @code{head} expression is evaluated immediatelly. The value of @code{head} will be returned by @fun{pipe-head} called for the pipe object returned by @code{make-pipe}. Evaluation of @code{tail} expression is delayed until @fun{pipe-tail} is called for the pipe returned by this function. Evaluation of @code{tail} expression should produce a pipe or a list.
@arg[func]{a function}
@arg[node-sets]{@class{node-set}}
@return{a list}
@short{Calls @code{func} with N arguments for each N-tuple of nodes
on the N lists of @code{node-sets} and conses up a list of its
return values}
The operation is performed lazily, i.e. if it’s terminated via
a non-local exit it doesn’t necessarily cause the XPath engine to find
out all the nodes in @code{node-sets} internally.
@return{nil}
@short{Disables profiling.}
Disables profiling for future XPath compilations, but keeps recorded
profiling samples for @fun{report}.
Previously returned closures that were created with profiling enabled
will not record samples until profiling is re-activated.
@see{enable-profiling}
uri
.
@return{nil}
@short{Enables profiling.}
Resets any existing profile samples and enables profiling for future
XPath compilations.
Previously returned closures that were created with profiling disabled
are not affected by this setting, but closures created during an earlier
profiling session will start sampling again.
But note that @fun{evaluate}, @fun{node-matches-p}, and @fun{pattern-case}
will recompile their cached closure when this setting has changed.
Profiling is not thread safe.
@see{disable-profiling}
@see{report}
@arg[pipe]{a pipe}
@arg[count]{a non-negative integer}
@arg[key]{a function}
@arg[result]{an object}
@return{the value of @key{result} (the value of @code{pipe} by default)}
Goes through all or @code{count} elements of pipe,
possibly applying the @code{key} function.
uri
.
@arg[local-name]{local part of the function name}
@arg[uri]{namespace URI of the function}
@return[uri]{an XPath function object}
@short{Performs an XPath function lookup using standard lookup rules}
All defined extensions for the namespace specified by @code{uri} are scanned for function with specified @code{local-name}.
@arg[node-or-node-set]{a @class{node-set} or a single XML node}
@return{an alphanumeric string}
@short{Generates an unique identifier for the first node @code{node-set}
(or, if a node is specified, for that node).}
This function is similar to the generate-id() XSLT function, but its results are unique only within its document, whereas XSLT also prepends an ID designating the document.
@arg[pipe]{a pipe}
@arg[ordering]{one of :document-order, :reverse-document-order, :unordered}
@return{a @class{node-set}}
Makes a @class{node-set} containing nodes from the @code{pipe} with specified @code{ordering}.
Map fn over pipe, delaying all but the first fn call, collecting results
lazily map fn over pipe, appending results
Map fn over pipe, delaying all but the first fn call, appending results, filtering along the way
Compare nodes according to document order.
key
.
@arg[pipe]{a pipe}
@return{an object}
Returns the head of the @code{pipe}.
@arg[node-set]{a @class{node-set}}
@return{a pipe}
Returns the pipe that contains the elements of the @code{node-set}.
@arg[pipe]{a pipe}
@arg[node-set]{a @class{node-set}}
@return{the value of @code{pipe}}
Sets the pipe that contains the element sof the @code{node-set}.
@arg[pipe]{a pipe}
@return{an object}
@short{Returns the tail of the list.}
First time @code{pipe-tail} is called it causes pipe tail expression to be evaluated and remembered for later calls.
@arg[group-identical-expressions]{Boolean, indicates whether times
recorded for closures that were compiled separately, but for the same
expression, are to be summed together. Default is T.}
@short{Shows profiling output.}
Shows cumulative run time and real time, number of calls, and average
run time for each XPath expression or XPattern matcher that was invoked.
@see{enable-profiling}
@see{disable-profiling}
cxml-xmls
.
cxml-xmls
.
uri
.
cxml-xmls
.
cxml-xmls
.
cxml-xmls
.
uri
.
name
.
@arg[environment]{an XPath environment object}
@arg[local-name]{local part of expanded-name of the function}
@arg[uri]{namespace URI of the function}
@return{an XPath function or nil if it cannot be found}
@short{Finds an XPath function by @code{local-name} and @code{uri}}.
XPath function is a Lisp function that takes zero or more "thunks"
as its arguments (corresponding to XPath expressions passed as function
arguments) and returns a new "thunk". A "thunk" is a function
that takes an instance of @class{context} as its argument and returns
the value of one of XPath types.
test-environment
) lname uri) ¶dynamic-environment
) lname uri) ¶@arg[environment]{an XPath environment object}
@arg[prefix]{prefix part of a QName}
Returns namespace URI for specified @code{prefix}.
test-environment
) prefix) ¶dynamic-environment
) prefix) ¶@arg[environment]{an XPath environment object}
@arg[local-name]{local part of expanded-name of the function}
@arg[uri]{namespace URI of the function}
@return{XPath variable "thunk"}
@short{Finds an XPath variable by @code{local-name} and @code{uri}}.
XPath variable is represented by a "thunk". A "thunk" is a function
that takes an instance of @class{context} as its argument and returns
the value of one of XPath types.
test-environment
) lname uri) ¶dynamic-environment
) lname uri) ¶structure-object
.
attribute-pipe-using-navigator
.
child-pipe-using-navigator
.
hash-key-using-navigator
.
local-name-using-navigator
.
namespace-pipe-using-navigator
.
namespace-prefix-using-navigator
.
namespace-uri-using-navigator
.
node-equal-using-navigator
.
node-p-using-navigator
.
node-text-using-navigator
.
node-type-p-using-navigator
.
node-type-p-using-navigator
.
parent-node-using-navigator
.
qualified-name-using-navigator
.
structure-object
.
structure-object
.
cxml-xmls
.
structure-object
.
attribute-pipe-using-navigator
.
child-pipe-using-navigator
.
hash-key-using-navigator
.
local-name-using-navigator
.
namespace-pipe-using-navigator
.
namespace-uri-using-navigator
.
node-equal-using-navigator
.
node-p-using-navigator
.
node-type-p-using-navigator
.
node-type-p-using-navigator
.
qualified-name-using-navigator
.
Jump to: | %
(
A B C D E F G H I L M N O P Q R S T U V W X |
---|
Jump to: | %
(
A B C D E F G H I L M N O P Q R S T U V W X |
---|
Jump to: | *
+
C D E F K L M N O P S T U V |
---|
Jump to: | *
+
C D E F K L M N O P S T U V |
---|
Jump to: | A C D E F L N P S T U X |
---|
Jump to: | A C D E F L N P S T U X |
---|