Section 7.4.4 contains the sentence (braces inserted to indicate the intended reading) {If no argument is supplied or if the argument is the context item} and the context item is undefined an error is raised: [err:XPDY0002]XP. which can easily be misread as: If no argument is supplied or {if the argument is the context item and the context item is undefined} an error is raised: [err:XPDY0002]XP. The same problem also occurs for fn:normalize-space(). Possible alternative wording: If no argument is supplied or the argument is the context item then an error is raised if the context item is undefined: [err:XPDY0002]XP. However, the same error is raised if the argument is any other expression whose value depends on the context item, for example @att; the error here is nothing specific to this function. So I would suggest changing the paragraph in which the sentence occurs to: If no argument is supplied, $arg defaults to the string value of the context item (that is, the value of the expression string(.)). If the context item is undefined this will result in an error: [err:XPDY0002]XP.
The same problem was reported for fn:normalize-space in bug #4974, and fixed by means of erratum E14. A similar solution was adopted to the one proposed here.
Erratum E34 has been drafted to clarify the offending sentence. The bug is accordingly being marked fixed and closed.