This project is archived and is in readonly mode.
Hash.from_xml chokes on attributes
-
Morten
Ah blimey.. The formatting is off.
-
Pratik
- Assigned user changed from Jeremy Kemper to Pratik
- State changed from new to incomplete
Could you please submit a patch/test - http://rails.lighthouseapp.com/p... and we can get this in.
Thanks!
-
nofxx
I can confirm the bug and that the patch fixes it.
Example XML:
"<?xml version="1.0" encoding="UTF-8"?>\n
can't typecast "16"
ONLY on ruby 1.9, 1.8 runs fine w/o patching.
If it helps, I made it.
-
nofxx
Sorry, formatting...
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<stories type=\"array\" total=\"16\" count=\"16\">\n <story>\n... "can't typecast "36"
-
Jeremy Kemper
Please include a test case as well.
-
nofxx
Hi Jeremy,
Yea, shame on me.. heh. Here we go:
-
nofxx
Ops, "from_xml" not "to"... fixed:
-
Santiago Pastorino
- State changed from incomplete to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
-
Adrian
- Assigned user cleared.
I have just been bitten by this bug. Processing an xml string that contained both attributes and text element values, the attributes were completely whacked, breaking the program. If this flattened out the XML appropriately, it is a superb way to easily decode XML values into a hash that be manipulated and persisted. I know everybody's busy, I just never guessed that a method called Hash.from_xml would create a hash that didn't contain all the XML. v3.0.3.
