如何从 jenkins 的 RESTAPI 表达式中删除 html 标签?
how to remove html tags from a jenkins' RESTAPI expression?
我有什么
api/xml?depth=2&xpath=//lastSuccessfulBuild/artifact/relativePath&wrapper=all
其中显示
<all>
<relativePath>
poky/files-in-image.txt
</relativePath>
<relativePath>
poky/eglibc/core-image/image-info.txt
</relativePath>
</all>
完成
我只需要知道是否可以在地址中添加一些内容来删除 html 标签,这样就只剩下路径了?
切换到使用 JSON 而不是 xpath。
如果您需要解析 JSON,请在您的 bash 脚本中使用 JQ http://stedolan.github.io/jq/
我有什么
api/xml?depth=2&xpath=//lastSuccessfulBuild/artifact/relativePath&wrapper=all
其中显示
<all>
<relativePath>
poky/files-in-image.txt
</relativePath>
<relativePath>
poky/eglibc/core-image/image-info.txt
</relativePath>
</all>
完成
我只需要知道是否可以在地址中添加一些内容来删除 html 标签,这样就只剩下路径了?
切换到使用 JSON 而不是 xpath。
如果您需要解析 JSON,请在您的 bash 脚本中使用 JQ http://stedolan.github.io/jq/