我可以如何在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()
I get:
This is that I need.
它缺少其中的一些文本
部分。
有什么想法可以返回这是我需要的一些文本。
?
谢谢。