I am trying to use the following code to convert XML to object and use it in the code.
var decoder:SimpleXMLDecoder = new SimpleXMLDecoder(true);
var salesVO:Object = decoder.decodeXML(xmlDoc) ;
I have an attribute of type String with name "ItemName" which has value
<ItemName>01234567890123456789</ItemName> in XML
once the above code is executed I am geeting the value for ItemName as 1.2e+15 etc in salesVO. which means the xmldecoder is taking string like number.
Is there a way to prevent this.
Try to include single quotes around the number in xml. Since the decoder will treat it as a numeric...but not string
Check it once and let me know if it works..
<ItemName>'01234567890123456789'</ItemName> in XML
I have tested it its working fine even without sinngle quotes...
Can you please post your xml file which you are trying to convert into an object.
Anyone has a solution for this issue?