有人可以解釋爲什麼FLEX 4.5 XMLDecoder對我的XML數據執行此操作嗎?FLEX XMLDecoder將`09.00`轉換爲「09.00」,但將`10.00`轉換爲10
var decoder:XMLDecoder = new XMLDecoder;
var $object:Object = decoder.decode(<xmltag>08.00</xmltag>);
// object = "08.00"
var decoder:XMLDecoder = new XMLDecoder;
var $object:Object = decoder.decode(<xmltag>11.00</xmltag>);
// Object = "11" (HEY! Where did my '.00' part of the string go?)
var decoder:XMLDecoder = new XMLDecoder;
var $object:Object = decoder.decode(<xmltag>11.30</xmltag>);
// Object = "11.3" (HEY! Where did my '0' part of the string go?)
看起來是試圖打字。你是否試圖將數據包裝在cData標籤中? – 2011-05-31 19:21:39
hm,仔細觀察調試器......第一個值(08.00)以字符串形式返回。但另外兩個(11和11.3)已經被轉換爲「非」字符串。 – Erik 2011-05-31 19:25:23
不!將字符串包裝在cData標籤中並沒有幫助。 – Erik 2011-05-31 20:05:20