I have an object that gets serialized using the XmlSerializer class. Users can input data...this data gets Serialized and then De-Serialized later.
The input data, the user needs to be able to enter the "&" character. The input looks like so...
Code:myObject.AlternateAddress1 = "Sampson & Meyes Inc."; myObject.AlternateAddress2 = "Lexington & Fairfield"; myObject.AlternateAddress3 = "By the old KMart & the new Stabucks"; myObject.AlternateAddress4 = "Washington & Heights NJ"
After Serialization, the XML String looks like this
The problem I'm having is the Data seems to get Serialized just fine. It is erroring when trying to DeSerialize the info back into the object. It apparantly doesn't like the "&". Not sure why since the Serializer put it there...Code:<AlternateAddress1>Sampson & Meyes Inc.</AlternateAddress1> <AlternateAddress2>Lexington & Fairfield</AlternateAddress2> <AlternateAddress3>By the old KMart & the new Stabucks</AlternateAddress3> <AlternateAddress4>Washington & Heights NJ</AlternateAddress4>
Any thoughts on how to get around this?


Reply With Quote