Commit graph

4 commits

Author SHA1 Message Date
Kim Alvefur
00584c4d61 util.stanza: Handle namespace prefixes for attributes in :find()
More correct handling of namespaces here.

This works with both prefixes from the parser and hacky .attr["foo:bar"]
2024-11-17 12:35:51 +01:00
Kim Alvefur
8a96854733 util.xtemplate: Fix error on applying each() to zero stanzas 2024-07-11 15:04:29 +02:00
Kim Alvefur
251f4d3c8a util.xtemplate: Test the each template function
It iterates over childtags, so a template like {foo|each{...}} would be
equivalent to root:childtags("foo"), while a deeper query needs the bit
that becomes arguments to :childtags as an argument to each, e.g.
{foo/bar|each(baz)} would behave like
root:get_child("foo"):get_child("bar"):childtags("baz")
2023-12-16 13:47:55 +01:00
Kim Alvefur
36914c9d99 util.xtemplate: Add some initial tests
Strict typing does not magically make code correct
2023-12-09 15:15:06 +01:00