gpt4 book ai didi

xml - FFProbe XML XPath

转载 作者:行者123 更新时间:2023-12-04 22:56:47 26 4
gpt4 key购买 nike

我一直在尝试使用 XPath 并将变量从 FFProbe 提供的 XML 中提取出来。
/ffprobe/streams/codec_type

 <?xml version="1.0" encoding="UTF-8"?> 
<ffprobe>
<streams>
<stream index="0" codec_name="mpeg2video" codec_long_name="MPEG-2 video"/>`
</stream>
</streams>
</ffprobe>

最佳答案

你的 XPath,

/ffprobe/streams/codec_type
选择 codec_type具有指定遗产的元素,但您的 XML,
<?xml version="1.0" encoding="UTF-8"?> 
<ffprobe>
<streams>
<stream index="0" codec_name="mpeg2video" codec_long_name="MPEG-2 video"/>`
</stream>
</streams>
</ffprobe>
  • 没有这样的元素,并且
  • 格式不正确,因为它有一个无关的 </stream>自关闭 <stream/> 之后的结束标签标签。
  • 关于xml - FFProbe XML XPath,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71417514/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com