XMLStarlet doesn't select xpath query correctly

I have the following XML <?xml version=’1.0′ encoding=’UTF-8′?> <ListBucketResult xmlns=’http://doc.s3.amazonaws.com/2006-03-01′&gt; <Name>chromedriver</Name> <Prefix></Prefix> <Marker></Marker> <IsTruncated>false</IsTruncated> <Contents> <Key>2.0/chromedriver_linux32.zip</Key> <Generation>1380149859530000</Generation> <MetaGeneration>4</MetaGeneration> <LastModified>2013-09-25T22:57:39.349Z</LastModified> <ETag>"c0d96102715c4916b872f91f5bf9b12c"</ETag> <Size>7262134</Size> </Contents> <Contents> <Key>2.0/chromedriver_linux64.zip</Key> <Generation>1380149860664000</Generation> <MetaGeneration>4</MetaGeneration> <LastModified>2013-09-25T22:57:40.449Z</LastModified> <ETag>"858ebaf47e13dce7600191ed59974c09"</ETag> <Size>7433593</Size> </Contents> … </ListBucketResult> And I tried select only Key node with this command: xmlstarlet sel -T -t -m ‘/ListBucketResult/Contents/Key’ -v ‘.’ -n file.xml I tried some… Read More XMLStarlet doesn't select xpath query correctly

Extract specific values from XML configuration

Input XML looks like several blocks of: <Parties> <Party compid="CUST1" side="1"> <Connections> <SocketConnection listenport="9029" /> </Connections> </Party> </Parties> My goal is to extract to each customer his specific params like: compid;listenport By now I can get all customers using xmlstarlet fo -D config.xml | xmlstarlet select -T -t -m ‘//Parties/Party’ -v ‘@compid’ -nl Next step… Read More Extract specific values from XML configuration