如何在 XQuery 中去除一组标签,但仍将其文本保留在那里?例如,如果我有:
<root>
<childnode>This is <unwantedtag>some text</unwantedtag> that I need.</childnode>
</root>
如何去除不需要的标签以获得:
<root>
<childnode>This is some text that I need.</childnode>
</root>
实际上,我真正想要的只是文本,例如:
This is some text that I need.
当我执行以下操作时:
let $text := /root/childnode/text()
我得到:
This is that I need.
它缺少它的some text
一部分。
关于如何退货的任何想法This is some text that I need.
?
谢谢你。