On (element) nodes, fn:data() is supposed to return the typed-value of the node. On non-validated nodes (which is what we always have, as we don't support validation), the typed-value of a node is exactly the string-value of the node, but as type `untypedAtomic'.
On (element) nodes, fn:data() is supposed to return the typed-value
of the node. On non-validated nodes (which is what we always have,
as we don't support validation), the typed-value of a node is exactly
the string-value of the node, but as type `untypedAtomic'.

We thus rewrite

  pf:typed-value (e)

into

  let $v := string-value (e) return $v cast as untypedAtomic

in coreopt.brg.

(While I was at it, I discovered a typo in coreopt.brg: It's not
fn:string-value(), but pf:string-value().)

zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb,zyzyis/monetdb