Home > AS3 > AS3:Namespace Remover

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.

[ DOWNLOAD SOURCE HERE ]

Categories: AS3 Tags:
  1. Panel
    May 27th, 2008 at 09:04 | #1

    All gofr sources links are down. Any change to get gofr sources (maybe you can email them to me)?

  2. Cleverson
    March 16th, 2010 at 08:12 | #2

    Tankssss you save the day !!! :D

  3. François
    September 6th, 2010 at 08:35 | #3

    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 :-)

  4. Andy C
    January 10th, 2011 at 13:06 | #4

    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

  5. Andy C
    January 10th, 2011 at 13:08 | #5

    (Re. above – the code I pasted has been omitted – it was the node with ‘xmlns’ content)

  6. August 5th, 2011 at 16:37 | #6

    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.

  7. August 5th, 2011 at 16:40 | #7

    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

  8. Thomas
    September 21st, 2011 at 07:14 | #8

    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.

  9. Thomas
    September 21st, 2011 at 07:16 | #9

    the comment form removed some of my code…. but I guess you see what I’m up to ;)

  10. Andy C
    November 21st, 2011 at 09:01 | #10

    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).

  1. No trackbacks yet.