What's wrong with this sed command? delete & append

I want to write a sed command that does the following work:

file:

<a>asdfasdf<\s>
     <line>hello</line>
       <b>adf<\c>
  <b>tttttttt<\c>

output:

name=hello
sed -e 's/^[ \t]*//' -n -e '/<line>/s/<[^<]*>//gp;' -e 's/^/name="/g' file

but I can not append "=" after getting the line with front space deleted.
I have an alternate way to get around the problem.

But I don't understand why it wouldn't work.
Any suggestions would be great!!!

try something like this, I don't get some of your regexes:

 grep '<line>' filename | sed 's/\<[\/a-z]*\>//g'

Try:

sed -n '/<line>/s/.*>\(.*\)<.*/name=\1/gp' file

Regards

beautiful~:b::b::b::b::b::b::b::b:

put this in a sed script
cat >sedscript

# sed -n -f sedscript test

you should use a dedicated XML/HTML parser instead