Help - Parsing data in XML in Linux

Hi,

I have an XML file in Linux and it contains a long string of characters. The last part of the file is like
.......
.......
.......
CAD</MarketDescription></InvestorTransaction></AdvisorAccount></DivisionAdvisor></Division>
<AccountCount>41</AccountCount><TransactionCount>81</TransactionCount></SmartProspectus>

I am trying to extract the number of transaction counts (81, highlighted in red) only so that I can use this value in the email. This transaction count is not fixed and can be any of value. It could be anywhere between 0 and 999999.

Can please someone help me.

Thanks

Naveed

Refer this thread. Replace ACCOUNT_ID with TransactionCount

try also:

value=$(sed -n '/TransactionCount/s/.*< *TransactionCount *> *\([^<]*\)<.*/\1/p' xml_file)

Thanks a lot rdxtr1. It works like a charm.

Naveed