Yes, this is required. The namespace scoping opeartor :: only applies to a single level when using  the . operator to dot down level by level.

 

But I think you should be able to use the .. operator to get to PlanNumber without going through Plans:

 

XML(obj_data)..ns_dmws::PlanNumber

 

- Gordon

 


From: [email protected] [mailto:[email protected]] On Behalf Of ben.clinkinbeard
Sent: Wednesday, June 14, 2006 1:38 PM
To: [email protected]
Subject: [flexcoders] Re: The namespace that won't die

 

Anyone? I shouldn't have to use the namespace qualifier for every
level I go down, should I?

Thanks,
Ben

--- In [EMAIL PROTECTED]ups.com, "ben.clinkinbeard"
<ben.clinkinbeard@...> wrote:
>
> Hello, part 6735 in the namespace hell series... Shouldn't code like
this:
>
> XML(obj_data).ns_dmws::Plans.PlanNumber
>
> successfully access any and all PlanNumber nodes in a chunk of XML
> like this?:
>
> <Entry xmlns="http://site.com/Back/DocMetadata">
> <DocumentType>RPR</DocumentType>
> <Plans>
> <PlanNumber>78167</PlanNumber>
> <PlanNumber>78168</PlanNumber>
> </Plans>
> <Status>InProgress</Status>
> </Entry>
>
> It doesn't. In cases where there is only one PlanNumber node, I have
> to do this to get to it, because the namespace seems to attach itself
> to every child node even when accessed with the namespace:
>
> XML(obj_data).ns_dmws::Plans.ns_dmws::PlanNumber
>
> In cases where there are multiple PlanNumber nodes I can only access
> the node contents using square brackets because, again, the namespace
> attaches itself to each PlanNumber node. When there are multiple
> PlanNumber nodes, this code:
>
> XML(obj_data).ns_dmws::Plans.ns_dmws::PlanNumber
>
> outputs
>
> <PlanNumber xmlns="http://site.com/Back/DocMetadata">78167</PlanNumber>
> <PlanNumber xmlns="http://site.com/Back/DocMetadata">78168</PlanNumber>
>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to