Node.SetAttribute('homepagetype','3');
其中 的'3'打了引號,被作為字符處理了,字符'3'的ASCII碼=51
解決的辦法是去掉引號,改成 Node.SetAttribute('homepagetype',3);