find and replace using SED

I need to do a find and replace. I tried below logic but getting warnings Could you please help?

a=`echo "<!DOCTYPE aaaaa bbbbb  \"sample.dtd\">"`
b="<!DOCTYPE  aaaaa bbbbb  \" /a/b/c/datain/d_k/sample.dtd \">"
echo $a | sed -e "s/$a/$b/" > c.txt

getting the following error

sed: 0602-404 Function s/<!DOCTYPE aaaaa bbbbb  "sample.dtd">/<!DOCTYPE  aaaaa bbbbb  " /a/b/c/datain/d_k/sample.dtd ">/ cannot be parsed.

Thanks
Krishnakanth Manivannan

use different delimiter other than '/' in sed like '?' or ':'
because / is included in your variables a and b ,therefore you are getting errror.
use either of these sed commands in your last line.

 
   1) echo $a | sed -e "s:$a:$b:" > c.txt
   2) echo $a | sed -e "s?$a?$b?"  > c.txt