PDA

View Full Version : XML namespaces



Iceline
December 4th, 2007, 03:52 PM
I've loaded an xml from a SOAPwebservice and everything works fine but I can't acces the nodes inside this XML because there's a namespace declared in it.


var bl:XML = <getPostcardObjectResponse xmlns="http://tempuri.org/">
<getPostcardObjectResult>
<postcardsGroup>
<string>/thmbs/PostCards/5_1.jpg</string>
<string>/thmbs/PostCards/5_2.jpg</string>
<string>/thmbs/PostCards/5_3.jpg</string>
<string>/thmbs/PostCards/5_4.jpg</string>
<string>/thmbs/PostCards/5_5.jpg</string>
</postcardsGroup>
</getPostcardObjectResult>
</getPostcardObjectResponse>


I've tried removing the namespace etc. and looked all kinds of info for this up but I just can't find it.

I hope this makes it clear,
Thanks for your time.

Felixz
December 5th, 2007, 08:56 AM
Here is a solution found using Flash's help
var bl:XML = <getPostcardObjectResponse xmlns="http://tempuri.org/">
<getPostcardObjectResult>
<postcardsGroup>
<string>/thmbs/PostCards/5_1.jpg</string>
<string>/thmbs/PostCards/5_2.jpg</string>
<string>/thmbs/PostCards/5_3.jpg</string>
<string>/thmbs/PostCards/5_4.jpg</string>
<string>/thmbs/PostCards/5_5.jpg</string>
</postcardsGroup>
</getPostcardObjectResult>
</getPostcardObjectResponse>
var NS:Namespace =bl.namespace();
trace(bl.NS::getPostcardObjectResult.NS::postcards Group.NS::string)

Iceline
December 6th, 2007, 03:42 AM
Thanks, I've looked in the flash help but maybe I didn't found the right page or it was just too new for me.

Really thanks