No, I think it is a bug, since the docs say that the contents get "normed". This code seems to leave the text node alone instead of substituting the new one.
The other question is, if a node in the heirarchy of XML being "normed" has an xml:space="preserve" attached to it, the surely the norm should not proceed further. There's no such test.
I think the original author (here Wolfgang) should have a look at it.
I'm trying to get my XML tested (see my mail on "Impracticallity with Test Suite assertEquals" (there's probably a bug there since the lerroring ine number does not appear)) and I stumbled against this one.
From: Joe Wicentowski <[hidden email]> Sent: Monday, March 20, 2017 7:28 PM To: Jonathan Rowell Cc: eXist open Subject: Re: [Exist-open] TestSuite: Is this a bug?
> In the "case text()" the node is normed and if the string is empty an empty
> sequence is returned. Otherwise the original node is returned rather than
> the normed text.