attr
function
Usage: (attr attrname)
(attr loc attrname)
Returns the xml attribute named attrname, of the xml node at location loc.
Source
attr=
function
Usage: (attr= attrname attrval)
Returns a query predicate that matches a node when it has an
attribute named attrname whose value is attrval.
Source
seq-test
function
Usage: (seq-test preds)
Returns a query predicate that matches a node when its xml content
matches the query expresions given.
Source
tag=
function
Usage: (tag= tagname)
Returns a query predicate that matches a node when its is a tag
named tagname.
Source
text
function
Usage: (text loc)
Returns the textual contents of the given location, similar to
xpaths's value-of
Source
text=
function
Usage: (text= s)
Returns a query predicate that matches a node when its textual
content equals s.
Source
xml->
function
Usage: (xml-> loc & preds)
The loc is passed to the first predicate. If the predicate returns
a collection, each value of the collection is passed to the next
predicate. If it returns a location, the location is passed to the
next predicate. If it returns true, the input location is passed to
the next predicate. If it returns false or nil, the next predicate
is not called.
This process is repeated, passing the processed results of each
predicate to the next predicate. xml-> returns the final sequence.
The entire chain is evaluated lazily.
There are also special predicates: keywords are converted to tag=,
strings to text=, and vectors to sub-queries that return true if
they match.
See xml_test.clj for examples.
Source
xml1->
function
Usage: (xml1-> loc & preds)
Returns the first item from loc based on the query predicates
given. See xml->
Source