tags:

views:

31

answers:

1
<MyXmlType>
   <MyXmlElement>Value</MyXmlElement>
</MyXmlType>

I need a small help here. I was trying to change the innertext value of here. After i change the value and save it with Xmldocument object. When I opened the file, I found that it has got saved in this format.

<MyXmlType>
   <MyXmlElement>Value</MyXmlElement>
</MyXmlType>>

Please note this </MyXmlType>> ">>". I dont know what is happening. Please help...

+1  A: 

My guess is that you were changing the inner text to something which was one character shorter, and then overwriting the file in place instead of overwriting it with a brand new file. That would mean the extra > was left from the previous version of the file.

If you could show the code you're using to write the file, that would help a lot.

Do you get the same problem if you write to a new file?

Jon Skeet