I’m attaching a simple workaround (not sure if it will do the trick for you but it will get you started).  This is a modified version of XMLObjectOutput in that it doesn’t store attributes in an attribute map, it instead attaches them to the main object like HTTPService would normally.

 

HTH,

Matt

 


From: Matt Chotin [mailto:[EMAIL PROTECTED]
Sent: Friday, March 18, 2005 9:06 PM
To: [email protected]
Subject: RE: [flexcoders] Data loss (datatyping?)

 

Your explanation as to what is happening sounds correct, that’s a bug you should file at http://www.macromedia.com/go/wish.  The only workaround I can recommend is to use the xmlDecode function to turn the XML into an object structure instead of our default decoding mechanism.  The XMLObjectOutput class in the extras folder might do the trick.

 

Matt

 


From: Cynthia Lee [mailto:[EMAIL PROTECTED]
Sent: Friday, March 18, 2005 10:12 AM
To: [email protected]
Subject: [flexcoders] Data loss (datatyping?)

 

I've run into an oddity with how Flex handles incoming xml data (in
particular, the results of an HTTPService call).  Given the following
xml:

<name label="DOE, JOHN" data="" isBranch="true">
   <award label="75394D" data="">
   <award label="75394E" data="">
   <award label="75394F" data="">
</name>

Flex chops off the "E" in the label attribute of the second award tag
(label="75394E").  So, if I dump the label values into, say, a list, the
list contents appear as:

75394D
75394
75394F

However, Flex does the right thing when the last character is not an "E"
(or "e"), or when the trailing "E" is preceded by other alpha characters
(e.g. "ABCDFGE").

The "E" has already been lost by the time the data gets stored in the
HTTPService's result object.  When I run the typeof function against the
label values, the first and third records (excluding the name tag)
return a type of string, whereas the second record returns a type of
number.

Perhaps Flex looks at "75394E" and thinks it's an exponential number
that's missing the exponent, and so removes the "E"?

Can anyone think of another explanation for this behavior?  If not, is
there a way to force Flex to type the data as strings?




Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Attachment: XMLObjectOutput.as
Description: Binary data

Attachment: test.mxml
Description: Binary data

Attachment: test.xml
Description: Binary data

Reply via email to