我只想从 xml 中提取“图像”,但由于前几个不包含“图像”,因此出现错误。
<?xml version='1.0' encoding='utf-8'?>
<document>
<job name="Job1">
<type>
<description>
</description>
</type>
</job>
<job name="Job2">
<type>
<description>
</description>
</type>
</job>
<job name="Job3">
<type>
<description>
<image>
<png></png>
</image>
</description>
</type>
</job>
</document>
它如何跳过前两个并匹配第三个图像标签?
xmllint --xpath "//*[local-name()='document']/job/type/description/image/png/text()" file