使用xmlstarlet从具有名称空间的XML中提取元素



提取字符串"BkDHOZICQpereh46o84yUQ|mwu76ctmJWcf6heNsvNBudrAaia9xEQH"的xmlstarlet语法是什么?

<?xml version='1.0' encoding='UTF-8'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.12.xsd">
<credentials token="BkDHOZICQpereh46o84yUQ|mwu76ctmJWcf6heNsvNBudrAaia9xEQH">
<site id="478d0aef-142d-456b-94d5-9a8919d85e82" contentUrl=""/>
<user id="2e713141-0da2-471b-b2ac-8ae3974b4df5"/>
</credentials>
</tsResponse>

我明白了!

xmlstarlet sel -N api=http://tableau.com/api -t -v //api:credentials/@token -n response.xml