我的 xml 内容“CommandDefinition”=
<command category="213" id="3" type="om">
<name>CMD_1</name>
<description>this is the desc</description>
<parameter pos_index="1">
<description>device index</description>
<state>1</state>
</parameter>
</command>
<command category="213" id="4" type="om">
<name>CMD_2</name>
<description>This parameter belongs to FAPService.{i}.Capabilities.</description>
<parameter pos_index="1">
<description>device index</description>
<state>1</state>
</parameter>
</command>
我正在尝试检索命令标记的整个节点值,其中名称属性保存值“CMD_2”。即检索值应如下所示:
<command category="213" id="4" type="om">
<name>CMD_2</name>
<description>This parameter belongs to FAPService.{i}.Capabilities.</description>
<parameter pos_index="1">
<description>device index</description>
<state>1</state>
</parameter>
</command>
我尝试了以下方法:
ExtractValue(CommandDefinition, '//命令[name= "CMD_2"]')
但这会返回一个空字符串。对此有什么想法吗?谢谢
最佳答案
这个链接非常有帮助: 点击这里! http://www.codeproject.com/Articles/71336/MySQL-XML-User-Defined-Functions ?
关于php - Mysql extractvalue 函数从 xml 内容中检索 xml 片段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29356943/