我想知道在PHP中是否存在转换xpath的直接方式(没有迭代),比如说:
component_volume_concentration/component[1][@formula="CH4"]
component_volume_concentration/component[1][@unit="%"]
component_volume_concentration/component[1][@min="22"]
component_volume_concentration/component[1][@norm="25"]
component_volume_concentration/component[1][@max="30"]
到XML节点和属性结构:
<component_volume_concentration>
<component formula="CH4" unit="%" min="22" norm="25" max="30" />
<component formula="C2H6" unit="%" min="22" norm="25" max="30" />
<component formula="C3H8" unit="%" min="22" norm="25" max="30" />
<component formula="i-C4H10" unit="%" min="22" norm="25" max="30" />
<component formula="i-C5H12" unit="%" min="22" norm="25" max="30" />
</component_volume_concentration>
谢谢!