douju6542 2015-03-30 21:47
浏览 409

Mysql extractvalue函数从xml内容中检索xml片段

My xml content "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>

I am trying to retrieve entire node value of command tag, where name attribute holds value "CMD_2". i.e. retrieve value should look like:

<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>

I tried following:

ExtractValue(CommandDefinition, '//command[name= "CMD_2"]')

But this returns me an empty string instead. Any thought on this? Thx

  • 写回答

1条回答 默认 最新

  • douguizhuang8276 2015-04-07 15:09
    关注
    评论

报告相同问题?

悬赏问题

  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 正弦信号发生器串并联电路电阻无法保持同步怎么办
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)