take a look at this little script I wrote to parse your basic sqlplus login string
input should be in the format user/pass@inst
#!/usr/bin/ksh
######################
## login string parser
######################
echo "Input your login string:"
read string
echo "\nYou entered: $string"
export SRC_USERPASS=${string%%@*}
export SRC_USER=${SRC_USERPASS%%/*}
export SRC_INST=${string##*@}
## echo "USER and PASS: $SRC_USERPASS"
echo $SRC_USERPASS | grep /
if [ $? = 0 ]
then
echo "There is a password"
export SRC_PASS=${SRC_USERPASS##*/}
echo "USER only: $SRC_USER"
echo "PASS only: $SRC_PASS"
echo "INST: $SRC_INST"
else
echo "There is NO password"
echo "You will be prompted for a password during execution"
echo "USER only: $SRC_USER"
echo "PASS only: $SRC_PASS"
echo "INST: $SRC_INST"
fi
hopefully this gets you started, but your parsing will be a bit more complex.
I suggest doing it line by line, then argument by argument.
something like supply the script your xml file, then grep it for the entire summary line. then parse that string for each variable (fatals, testcases, ...) (you will lbe ooking for whatever comes after fatals=" and then before the next ")
then grep the testresults line for the message and result variable.
cat filename | sed 's/<Report.*$/report/' | sed 's/<summary//' | sed 's/\/>//' | sed 's/"//g' | sed 's/<testresult.*message=//'| sed 's/result=.*$//' | sed 's/<\/Report version>//'