NOT USING A XML PARSER
I want to get the contents of the XML tag so my XML file looks like ( Includes more than XML this is just the XML part )
<ns1:CarrierServiceId>PD_PRIVATPAKKER_W</ns1:CarrierServiceId>
<ns1:LabellingReturned>0</ns1:LabellingReturned>
<ns1:DeliveryDate>2012-07-27T23:00:00Z</ns1:DeliveryDate>
<ns1:DespatchDate>2012-07-26T22:59:59Z</ns1:DespatchDate>
<ns1:International>0</ns1:International>
<ns1:ClearanceDocumentation>0</ns1:ClearanceDocumentation>
<ns1:ExceptionCode>0</ns1:ExceptionCode>
How would i get the contents of CarrierServiceId so i only get PD_PRIVATPAKKER_W and nothing else i’ve managed to get the line using below, but i need the contents
FOUND=$(awk '/<ns1:CarrierServiceId>/ {print $1}' TEST.tmp)
echo "${FOUND}"
Use the angle brackets as delimiters and print the field.