XML Expression Path Lookup
(require xexpr-path) | package: xexpr-path |
Utilities to find XML expression elements using a simple path.
value
Path is a list of components. A valid componenet can be:
| to match tag name, '* matches any tag | |
| to match an attribute | |
| to match tags with given attribute value |
procedure
(xexpr-path-list path xexpr) → (listof (or/c xexpr/c string?))
path : xexpr-path/c xexpr : xexpr/c
Elements can be matched using tag names.
Example: | |||||
|
In some cases, it can be handy to further filter the elements by values of their attributes.
Example: | ||||||
|
procedure
(xexpr-path-first path xexpr) → (or/c xexpr/c string? #f)
path : xexpr-path/c xexpr : xexpr/c
Examples: | ||||
|
procedure
(xexpr-path-text path xexpr) → (or/c string? #f)
path : xexpr-path/c xexpr : xexpr/c
Keep in mind that this function does not return plain string, but rather valid XML representation of the matched elements.
Example: | |||||
|