I am reading this question trying to do something like this. The answer given there does not solve my problem.
I want to use the visit operator to determine the "mass" of each subtree, so for each node I want to sum the masses of all descendants. For example, the visit step that encounters this node expression with a list in it:
\anode([\bnode()[@mass=1], \bnode()[@mass=2]], \cnode()[@mass=5])
should do this:
\anode([\bnode()[@mass=1], \bnode()[@mass=2]], \cnode()[@mass=5])[@mass=8]
Therefore, I do not just want to filter out non-nodes, but actually cross them. Including a case for lists in my visit statement does not work (at least not obvious) because the lists cannot contain annotations.
Is there a natural way to spread the entire annotation of information on the tree?
Anson source
share