![](/img/trans.png)
[英]How to get the value of an attribute whose name is not a literal in xQuery?
[英]XQuery: How to output string literal & in value of attribute
test.xqy:
element test
{
attribute haha {"&"}
}
命令行:
$ basex test.xqy
<test haha="&"/>
我需要输出: <test haha="&"/>
。 BaseX不处理XML实体?
文档<test haha="&"/>
格式不正确,因此没有机会使用BaseX或任何其他XML处理器获得此输出。 然而,哈哈的价值确实是'&'; 如果将属性值作为字符串返回,您将看到这个:
string(<test haha="&"/>/@haha)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.