xquery 将属性转换为标签
我正在学习Xquery。我的 XML 文档中有这个标签。
<element a="1" b="2" c="3" name="testgroupID">198</element>
<element a="11" b="12" c="13" name="testgroupverifyID" binary="hidden"/>
我可以知道如何使用 xquery 创建类似以下内容吗?
<mytags>
<a>1</a>
<b>2</b>
<c>3</c>
<name>testgroupID</name>
<value>198</value>
</mytags>
<mytags>
<a>11</a>
<b>12</b>
<c>13</c>
<name>testgroupverifyID</name>
<binary>hidden</binary>
</mytags>
目前我只能使用静态方式来做到这一点,例如:
$tag := $x/@a 然后用 {$tag
请建议返回。非常感谢。
I am learning on Xquery. I have this tag in my XML document.
<element a="1" b="2" c="3" name="testgroupID">198</element>
<element a="11" b="12" c="13" name="testgroupverifyID" binary="hidden"/>
May I know how to create something like the following with xquery?
<mytags>
<a>1</a>
<b>2</b>
<c>3</c>
<name>testgroupID</name>
<value>198</value>
</mytags>
<mytags>
<a>11</a>
<b>12</b>
<c>13</c>
<name>testgroupverifyID</name>
<binary>hidden</binary>
</mytags>
Currently I could only use the static way to do it, like:
$tag := $x/@a
and then return it with {$tag
Kindly advise. Thank you very much.
此 XQuery:
输出:
This XQuery:
Output: