- Home /
problem decoding xml file to object
hi.
i'm having this log affter loading correctly the xml file.
after try work around the problem i get no solution for it.
A first chance exception of type 'System.ArgumentException' occurred in System.Xml.Linq.ni.dll
An exception of type 'System.ArgumentException' occurred in System.Xml.Linq.ni.dll but was not handled in user code
Exception: Non white space characters cannot be added to content.
Type: System.ArgumentException
Module: System.Xml.Linq
InnerException: <No Data>
AdditionalInfo:<No Data>
at System.Xml.Linq.XDocument.ValidateString(String s)
at System.Xml.Linq.XContainer.AddStringSkipNotify(String s)
at System.Xml.Linq.XContainer.AddContentSkipNotify(Object content)
at System.Xml.Linq.XContainer.AddContentSkipNotify(Object content)
at System.Xml.Linq.XDocument..ctor(Object[] content)
at SerializeXml.DeserializeObject[T](String pXmlizedString)
at CrossPromotionButtons.Start()
at CrossPromotionButtons.UnityFastInvoke_Start()
i'm working in unity 4.3.1, and compile to wp8.
the code goes down in here
public static T DeserializeObject(String pXmlizedString) {
string xmlString = pXmlizedString;
XmlSerializer xs = new XmlSerializer(typeof(T));
MemoryStream memoryStream = new MemoryStream(StringToUTF8ByteArray(xmlString));
XDocument xmlText = new XDocument(memoryStream,Encoding.UTF8);
return (T)xs.Deserialize(memoryStream);
}
appreciate some help please thank's
Comment