AS3:Namespace Remover
I’ve received many emails about how to access the data from a SOAP response in gophr and haven’t had a chance to address this issue until now. Most of the issues come from the fact that a lot of people are having trouble with namespaces in E4X. So here’s a little class that removes namespaces and gives you the ability to access the data as if it was regular XML.
Categories: AS3
All gofr sources links are down. Any change to get gofr sources (maybe you can email them to me)?
Tankssss you save the day !!!
Thanks a LOT for this clean & neat package, it saved a good bunch of days in my work and I could easily get into your code to understand how to use it
Works a treat for me… almost…
I’m still left with on the node that contains the web service response.
Should this be stripped too? Being a ws novice, I’m not sure; but something is preventing the XML being accessed and I’m guessing that’s the reason.
Anyone able to shed some light?
Thanks
(Re. above – the code I pasted has been omitted – it was the node with ‘xmlns’ content)
Andy’s right. This is almost complete however the last node for every element gets the xmlns attribute added making it difficult to access and text in those nodes. I’m trying to figure it out… I’ll post if I do.
It only seems to affect nodes that are children of a node that had a namespace. It’s like it add the xmlns=”" to the subNodes in the XML…
@Moto
Thanks for sharing. Though I got my head twisted a bit due to two bugs… line 30 should be
attrString += attr[b].localName()+”=’”+attr[b]+”‘ “; (you had attr[0] there
and line 17 should be theXML = new XML(“”+ xml.text() +”"); to also remove namespaces from nodes with no child elements.
the comment form removed some of my code…. but I guess you see what I’m up to
Thanks for your work, but could you clarify it a little more? I tried dropping in your amended code above, but the best I could get was the child nodes without the XML tags (just the values).