fn:substring-before 的 Xquery 错误

Vic*_*ita 2 xpath xquery

    <url>{substring-before(data($y/link[1]/@href),'&')}</url>
Run Code Online (Sandbox Code Playgroud)

尝试运行时遇到的错误是

    No closing ';' found for entity or character reference
Run Code Online (Sandbox Code Playgroud)

任何人都知道是什么导致了这个错误?

Mic*_*Kay 5

在 XQuery 中,字符串文字(以及某些其他上下文中)中的 & 符号需要转义为&amp;,就像在 XML 中一样。